Commit Graph

27659 Commits

Author SHA1 Message Date
gdbadmin 9ad64e945d *** empty log message *** 2011-01-25 00:00:32 +00:00
Kevin Buettner 314d366acd * configure.tgt (mips*-*-elf): New; just like mips*-*-*, but
with remote-mips.o added to gdb_target_obs.
	* Makefile.in (ALL_TARGET_OBS): Add remote-mips.o.
2011-01-24 21:34:19 +00:00
Pedro Alves a491d753e8 * ada-valprint.c (val_print_packed_array_elements): Pass the
correct struct value to val_print.
	(ada_val_print_1): Ditto.
2011-01-24 21:28:12 +00:00
Pedro Alves 490f124f09 2011-01-24 Pedro Alves <pedro@codesourcery.com>
Don't lose embedded_offset in printing routines throughout.

	gdb/
	* valprint.h (val_print_array_elements): Change prototype.
	* valprint.c (val_print_array_elements): Add `embedded_offset'
	parameter, and adjust to pass it down to val_print, while passing
	`valaddr' or `address' unmodified.  Take embedded_offset into
	account when checking repetitions.
	* c-valprint.c (c_val_print): Pass embedded_offset to
	val_print_array_elements instead of adjusting `valaddr' and
	`address'.
	* m2-valprint.c (m2_print_array_contents, m2_val_print): Pass
	embedded_offset to val_print_array_elements instead of adjusting
	`valaddr'.
	* p-lang.h (pascal_object_print_value_fields): Adjust prototype.
	* p-valprint.c (pascal_val_print): Pass embedded_offset to
	val_print_array_elements and pascal_object_print_value_fields
	instead of adjusting `valaddr'.
	(pascal_object_print_value_fields): Add `offset' parameter, and
	adjust to use it.
	(pascal_object_print_value): Add `offset' parameter, and adjust to
	use it.
	(pascal_object_print_static_field): Use
	value_contents_for_printing/value_embedded_offset, rather than
	value_contents.
	* ada-valprint.c (val_print_packed_array_elements): Add `offset'
	parameter, and adjust to use it.  Use
	value_contents_for_printing/value_embedded_offset, rather than
	value_contents.
	(ada_val_print): Rename `valaddr0' parameter to `valaddr'.
	(ada_val_print_array): Add `offset' parameter, and adjust to use
	it.
	(ada_val_print_1): Rename `valaddr0' parameter to `valaddr', and
	`embedded_offset' to `offset'.  Don't re-adjust `valaddr'.
	Instead work with offsets.  Use
	value_contents_for_printing/value_embedded_offset, rather than
	value_contents.  Change `defer_val_int' local type to CORE_ADDR,
	and use value_from_pointer to extract a target pointer, rather
	than value_from_longest.
	(print_variant_part): Add `offset' parameter.  Replace
	`outer_valaddr' parameter by a new `outer_offset' parameter.
	Don't re-adjust `valaddr'.  Instead pass down adjusted offsets.
	(ada_value_print): Use
	value_contents_for_printing/value_embedded_offset, rather than
	value_contents.
	(print_record): Add `offset' parameter, and adjust to pass it
	down.
	(print_field_values): Add `offset' parameter.  Replace
	`outer_valaddr' parameter by a new `outer_offset' parameter.
	Don't re-adjust `valaddr'.  Instead pass down adjusted offsets.
	Use value_contents_for_printing/value_embedded_offset, rather than
	value_contents.
	* d-valprint.c (dynamic_array_type): Use
	value_contents_for_printing/value_embedded_offset, rather than
	value_contents.
	* jv-valprint.c (java_print_value_fields): Add `offset' parameter.
	Don't re-adjust `valaddr'.  Instead pass down adjusted offsets.
	(java_print_value_fields): Take `offset' into account.  Don't
	re-adjust `valaddr'.  Instead pass down adjusted offsets.
	(java_val_print): Take `embedded_offset' into account.  Pass it to
	java_print_value_fields.
	* f-valprint.c (f77_print_array_1): Add `embedded_offset'
	parameter.  Don't re-adjust `valaddr' or `address'.  Instead pass
	down adjusted offsets.
	(f77_print_array): Add `embedded_offset' parameter.  Pass it down.
	(f_val_print): Take `embedded_offset' into account.

	gdb/testsuite/
	* gdb.base/printcmds.c (some_struct): New struct and instance.
	* gdb.base/printcmds.exp (test_print_repeats_embedded_array): New
	procedure.
	<global scope>: Call it.
2011-01-24 18:54:17 +00:00
gdbadmin 23b1e6e450 *** empty log message *** 2011-01-24 00:00:03 +00:00
gdbadmin af1e3ccbec *** empty log message *** 2011-01-23 00:00:02 +00:00
gdbadmin bb38e8717f *** empty log message *** 2011-01-22 00:00:02 +00:00
Joel Brobecker 7bfc943420 move handing of "set interactive-mode" to gdb_has_a_terminal
The real purpose of this setting is really to override what the debugger
would otherwise guess from checking the stdin settings.  So it seems
more natural to see this setting being handled inside gdb_has_a_terminal
rather than input_is_terminal (which checks for other things, such as
whether the input is stdin, for instance).

This patch also adjust the command help and the associated section in
the GDB Manual to be a little clearer about that.

gdb/ChangeLog:

        * inflow.c: Include "gdbcmd.h".
        (interactive_mode): New static global, moved here from top.c.
        (show_interactive_mode): New function, moved here from top.c.
        use gdb_has_a_terminal instead of input_from_terminal_p to
        determine the current mode.
        (gdb_has_a_terminal): Add handling of the "iteractive-mode"
        setting.
        (_initialize_inflow): Add the "set/show interactive-mode"
        commands.  Moved here from top.c, after having adjusted slightly
        the help text.
        * top.c (interactive_mode, show_interactive_mode): Delete, moved
        to inflow.c.
        (input_from_terminal_p): Remove handling of "interactive-mode"
        setting, moved to infow.c.
        (init_main): Remove creation of the "set/show interactive-mode"
        commands, moved to inflow.c.

gdb/doc/ChangeLog:

        * gdb.texinfo (Other Misc Settings): Rework part of the
        documentation of the "set interactive mode" command.
2011-01-21 18:56:43 +00:00
Ken Werner 6da78614a3 gdb/testsuite/ChangeLog
2011-01-21  Ken Werner  <ken.werner@de.ibm.com>

        * lib/opencl.exp (skip_opencl_tests): Add missing compile_flags
        argument to the gdb_compile_opencl_hostapp call.
2011-01-21 14:05:51 +00:00
gdbadmin 995ac3ff08 *** empty log message *** 2011-01-21 00:00:33 +00:00
gdbadmin 2f1b715f20 *** empty log message *** 2011-01-20 00:00:32 +00:00
Joel Brobecker 446036530e [NEWS/ia64-hpux] Add entry for native ia64-hpux support
gdb/ChangeLog:

        * NEWS: Add entry for native ia64-hpux support.
2011-01-19 20:41:11 +00:00
Yao Qi ec64c9aa23 2011-01-19 Yao Qi <yao@codesourcery.com>
* lib/dwarf.exp (dwarf2_support): Change supported targets to a
	positve list.
2011-01-19 20:38:41 +00:00
Yao Qi 810cfdbbaf 2011-01-19 Yao Qi <yao@codesourcery.com>
* gdb.asm/asm-source.exp: Replace ARM target triplet with a
	canonical form.
	Remove "xscale-*-*"
	* gdb.xml/tdesc-regs.exp: Likewise.
	* gdb.python/py-section-script.exp: Replace ARM target triplet
	with canonical form.
	Match arm*-*-symbianelf*.
	* gdb.base/dup-sect.exp: Likewise.
	* lib/dwarf.exp: New.
	* gdb.dwarf2/callframecfa.exp: Check dwarf2 support by routine
	dwarf2_support.
	* gdb.dwarf2/dup-psym.exp: Likewise.
	* gdb.dwarf2/dw2-ada-ffffffff.exp: Likewise.
	* gdb.dwarf2/dw2-anonymous-func.exp: Likewise.
	* gdb.dwarf2/dw2-bad-parameter-type.exp: Likewise.
	* gdb.dwarf2/dw2-basic.exp: Likewise.
	* gdb.dwarf2/dw2-compressed.exp: Likewise.
	* gdb.dwarf2/dw2-const.exp: Likewise.
	* gdb.dwarf2/dw2-cp-infcall-ref-static.exp: Likewise.
	* gdb.dwarf2/dw2-cu-size.exp: Likewise.
	* gdb.dwarf2/dw2-double-set-die-type.exp: Likewise.
	* gdb.dwarf2/dw2-empty-namespace.exp: Likewise.
	* gdb.dwarf2/dw2-filename.exp: Likewise.
	* gdb.dwarf2/dw2-inheritance.exp: Likewise.
	* gdb.dwarf2/dw2-inline-param.exp: Likewise.
	* gdb.dwarf2/dw2-intercu.exp: Likewise.
	* gdb.dwarf2/dw2-intermix.exp: Likewise.
	* gdb.dwarf2/dw2-modula2-self-type.exp: Likewise.
	* gdb.dwarf2/dw2-noloc.exp: Likewise.
	* gdb.dwarf2/dw2-op-call.exp: Likewise.
	* gdb.dwarf2/dw2-producer.exp: Likewise.
	* gdb.dwarf2/dw2-ranges.exp: Likewise.
	* gdb.dwarf2/dw2-ref-missing-frame.exp: Likewise.
	* gdb.dwarf2/dw2-stack-boundary.exp: Likewise.
	* gdb.dwarf2/dw2-strp.exp: Likewise.
	* gdb.dwarf2/dw2-unresolved.exp: Likewise.
	* gdb.dwarf2/implptr.exp: Likewise.
	* gdb.dwarf2/mac-fileno.exp: Likewise.
	* gdb.dwarf2/member-ptr-forwardref.exp: Likewise.
	* gdb.dwarf2/pieces.exp: Likewise.
	* gdb.dwarf2/pr11465.exp: Likewise.
	* gdb.dwarf2/valop.exp: Likewise.
	* gdb.dwarf2/watch-notconst.exp: Likewise.
	* gdb.mi/dw2-ref-missing-frame.exp: Likewise.
2011-01-19 20:26:10 +00:00
Tom Tromey 4694da0147 gdb
PR mi/8618:
	* thread.c (free_thread): Free 'name'.
	(print_thread_info): Emit thread name.  Change CLI output.
	(thread_name_command): New function.
	(do_captured_thread_select): Emit newline.
	(_initialize_thread): Register 'thread name' command.
	* target.h (struct target_ops) <to_thread_name>: New field.
	(target_thread_name): New macro.
	* target.c (update_current_target): Handle to_thread_name.
	* python/py-infthread.c (thpy_get_name): New function.
	(thpy_set_name): Likewise.
	(thread_object_getset): Add "name".
	* linux-nat.c (linux_nat_thread_name): New function.
	(linux_nat_add_target): Set to_thread_name.
	* gdbthread.h (struct thread_info) <name>: New field.
gdb/doc
	* gdb.texinfo (Threads): Document thread name output and `thread
	name' command.
	(Threads In Python): Document Thread.name attribute.
	(GDB/MI Thread Commands): Document thread attributes.
gdb/testsuite
	* gdb.python/py-infthread.exp: Add thread tests.
2011-01-19 17:21:39 +00:00
gdbadmin c25658875f *** empty log message *** 2011-01-19 00:00:02 +00:00
Joel Brobecker 10d4437041 fix printing of Ada wide characters on ppc-aix
Same problem as before: We were downcasting the character value from
int to unsigned char, which caused an overflow.  The reason why we did
not see this problem before is probably related to the fact that
we're using stabs on AIX and thus characters types are defined as
a TYPE_CODE_INT (or TYPE_CODE_RANGE?).

gdb/ChangeLog:

        * ada-valprint.c (ada_print_scalar): Remove unsigned char downcast.
        (ada_val_print_1): Likewise.
2011-01-18 16:38:59 +00:00
Joel Brobecker e3acb1155b [powerpc] breakpoint inserted past function end
On powerpc, the prologue scanner reads instruction after instruction,
and just skips instructions that do not affect a frame.  This means
that it does not stop if if finds and unexpected instruction (which
could possibly happen with optimization, I presume). To avoid scanning
too many instructions, it tries to establish an upper limit.

The upper limit is first computed using the debugging (line) info,
but if that fails, it falls back on an arbitrary 100 bytes (or 25
instructions).  The problem is that, if the function is shorter than
those 25 instructions, we run the risk of skipping the entire function
and returning a PC that's outside our function.

In the event where we can find a symbol for a given PC (and therefore
can determine function start and end addresses), but cannot find an
upper limit using skip_prologue_using_sal, then we can at least limit
make sure that the 25 instructions do not put us beyour our function.
If it does, then further reduce the upper-limit to the end of the function.

gdb/ChangeLog:

        * rs6000-tdep.c (rs6000_skip_prologue): Make sure that the prologue
        upper limit address is not greater than the function end address
        when the upper limit could not be computed using the debugging
        info.
2011-01-18 16:18:26 +00:00
gdbadmin 849afc8b63 *** empty log message *** 2011-01-18 00:00:03 +00:00
Tom Tromey dc92e16124 * cli/cli-cmds.c (apropos_command): Free the compiled regex. Use
get_regcomp_error.
	* utils.c: Include gdb_regex.h.
	(do_regfree_cleanup): New function.
	(make_regfree_cleanup): Likewise.
	(get_regcomp_error): Likewise.
	* gdb_regex.h (make_regfree_cleanup, get_regcomp_error): Declare.
2011-01-17 16:50:42 +00:00
Tom Tromey f55af66d6e * cli/cli-cmds.c (apropos_command): Fix formatting. Don't call
re_compile_fastmap.
2011-01-17 16:20:56 +00:00
Pierre Muller a5a44b5381 * p-exp.y (intvar): New static variable, used to set CURRENT_TYPE
for internal variables.
	(last_was_structop): New static variable.
	(COMPLETE): New token.
	(field_exp): New rule to group all '.' suffix handling.
	Add mark_struct_expression calls when approriate to be able
	to correctly find fields for completion.
	(yylex): Adapt to handle field completion and set INTVAR when
	required.
2011-01-17 10:34:51 +00:00
gdbadmin e870b9ca1b *** empty log message *** 2011-01-17 00:00:33 +00:00
gdbadmin f9a63d49c7 *** empty log message *** 2011-01-16 00:00:33 +00:00
gdbadmin e8d8a7b622 *** empty log message *** 2011-01-15 00:00:03 +00:00
Yao Qi 2c291032cc 2011-01-14 Yao Qi <yao@codesourcery.com>
* arm-tdep.c (arm_register_reggroup_p): FPS register is in
	save_reggroup, restore_reggroup and all_reggroup.
2011-01-14 20:37:13 +00:00
Joel Brobecker b075872c94 new testcase printing wchar_t characters and strings
gdb/testsuite/ChangeLog:

        * gdb.base/wchar.c, gdb.base/wchar.exp: New testcases.
2011-01-14 19:33:37 +00:00
Joel Brobecker 2c3e6e2466 new testcase for Ada Wide Wide Characters and Strings
gdb/testsuite/ChangeLog:

        * gdb.ada/widewide: New testcase.
2011-01-14 19:33:19 +00:00
Joel Brobecker 447b483c37 Fix printing of Wide_Character & Wide_Wide_Character entities.
Wide_Characters and Wide_Wide_Characters are incorrectly printed.
Consider for instance:

    Medium : Wide_Character := Wide_Character'Val(16#dead#);

Trying to print the value of this variable yields:

    (gdb) p medium
    $1 = 57005 '["ad"]'

The integer value is correct (57005 = 0xdead), but the character
representation is not, it should be:

    $1 = 57005 '["dead"]'

Same for Wide_Wide_Characters.

There were two issues:
   (a) The first issue was in ada-valprint, where we were assuming
       that character types were 1 byte long;
   (b) The second problem was in c-valprint, where we were down-casting
       the integer value of the character to type `unsigned char',
       causing use to lose all but the lowest byte.

gdb/ChangeLog:

        * ada-valprint. (ada_printchar): Use the correct type length
        in call to ada_emit_char.
        * c-valprint.c (c_val_print): Remove cast in call to LA_PRINT_CHAR.
2011-01-14 19:32:56 +00:00
Pierre Muller 7b64a93b03 * solib-som.h (hpux_major_release): Declare variable here.
* solib-som.c:  Remove <sys/utsname.h> header.
	(DEFAULT_HPUX_MAJOR_RELEASE): New macro.
	(hpux_major_release): Make global, change default value to
	DEFAULT_HPUX_MAJOR_RELEASE.
	(get_hpux_major_release): Simply return HPUX_MAJOR_RELEASE.
	* hppa-hpux-nat.c: Add <sys/utsname.h> include.
	Add "solib-som.h" header.
	(set_hpux_major_release): New function.
	(_initialize_hppa_hpux_nat): Call set_hpux_major_release.
2011-01-14 18:39:31 +00:00
Mike Frysinger 4e18c05334 gdb: extend Linux osabi match
The current osabi default matching misses all *-uclinux tuples.

Signed-off-by: Mike Frysinger <vapier@gentoo.org>
2011-01-14 18:16:34 +00:00
Joel Brobecker a9df6b2252 fix ARI warnings introduced by ia64-hpux patches
gdb/ChangeLog:

        * ia64-hpux-nat.c (ia64_hpux_fetch_register): Remove trailing
        new-line at end of warning message.
        (ia64_hpux_store_register): Remove trailing new-line at end of
        error message.
        * ia64-hpux-tdep.c: Rephrase comment.
        * solib-ia64-hpux.c (struct dld_info): Change type of field
        dld_flags from "long long" to ULONGEST.
2011-01-14 13:53:02 +00:00
Pedro Alves ecb956dd69 * target.h (deprecated_child_ops): Delete declaration.
* target.c (deprecated_child_ops): Delete definition.
2011-01-14 13:47:15 +00:00
Pedro Alves 715f468029 gdb/
* Makefile.in (hpux-thread.o): Delete rule.
	* configure.ac: Don't check for HPUX DCE threads support.
	* configure, config.in: Regenerate.
	* hppa-hpux-nat.c (child_suppress_run): Delete.
	(hppa_hpux_child_can_run): Delete.
	(_initialize_hppa_hpux_nat): Don't override to_can_run.
	* hpux-thread.c: Delete.
2011-01-14 13:43:16 +00:00
Pedro Alves 76adfcaec1 * Makefile.in (hpux-thread.o): Delete rule.
* configure.ac: Don't check for HPUX DCE threads support.
	* configure, config.in: Regenerate.
	* hppa-hpux-nat.c (child_suppress_run): Delete.
	(hppa_hpux_child_can_run): Delete.
	(_initialize_hppa_hpux_nat): Don't override to_can_run.
	* hpux-thread.c: Delete.
2011-01-14 13:38:24 +00:00
gdbadmin a98d25b37c *** empty log message *** 2011-01-14 00:00:03 +00:00
Joel Brobecker 042e866ed2 delete hpux_pid_to_str (unused)
This function is unused, and the default formatting routine does
just fine, I think.   On pa-hpux:

        [New process 12565, lwp 2513]
        [New process 12565, lwp 2514]

So this patch deletes it.

gdb/ChangeLog:

        * hpux-thread.c (hpux_pid_to_str): Delete.
2011-01-13 23:55:34 +00:00
Joel Brobecker 4ffa5a3392 [Ada] Fix printing of Wide_Wide_Strings
This fixes the printing of Wide_Wide_String objects.  For instance,
consider:

    My_WWS : Wide_Wide_String := " helo";

Before this patch is applied, GDB prints:

    (gdb) print my_wws
    $1 = " ["00"]h["00"]e"

gdb/ChangeLog:

        * ada-valprint.c (ada_emit_char): Remove strange code.
        Check that c is <= UCHAR_MAX before passing it to isascii.
        (char_at): Do not assume that TYPE_LEN is either 1 or 2.
2011-01-13 23:01:22 +00:00
Joel Brobecker de8fa76c44 problem sourcing GDB script in interactive-mode on
When interactive-mode is not auto, GDB always uses that setting to
determine whether to act as if the input stream is a terminal or not.
However, this setting should only be honored if the input stream is
the standard input stream.  Otherwise, we run into trouble while
source-ing a GDB script, as shown below (on x86_64-linux):

        % cat script
        print 1
        print 2
        % gdb  -q
        (gdb) set interactive-mode on
        (gdb) source script
        (gdb) print 3
        $1 = 3

The lack of output and the fact that the "print 3" command returned
a value saved in $1 (as opposed to $3) indicates that the script was
not even evaluated at all.

gdb/ChangeLog:

        * top.c (input_from_terminal_p): Restrict the use of interactive_mode
        to the case where instream is stdin.

gdb/testsuite/ChangeLog:

        * gdb.base/interact.exp: New testcase.
2011-01-13 23:01:10 +00:00
Joel Brobecker c4de7027e3 [ia64-hpux] inferior function call support
We have two stacks to deal with on ia64, when making a function call.
The first is the usual stack frame, and the second is the register
stack frame.  On ia64-linux, the register frame is setup by adjusting
the BSP register.  Unfortunately for us, the HP-UX kernel does not allow
the debugger to change the value of the BSP.

To work around that limitation, the method I am using here is to push
some assembly code on the stack. This assembly code contains, among
other things, a call to the alloc insn, which sets up our frame for us.
An extensive comment in ia64-hpux-tdep.c explains the entire procedure.

Despite this approach, most of the code in ia64-tdep.c which sets up
the function call is still applicable - and only a few things need
to be done differently:  For instance, instead of changing the BSP,
we do nothing.  We store the parameters at a different location, etc.
So this patch also adjusts the inf-call code in ia64-tdep.c to make it
a little more extensible: I create a new ia64_infcall_ops structure
which allows an ABI to define how the few things that need to be
differentiated.

Another element that turned out to be necessary but is more of a detail
is that the computation of the linkage pointer needs to be handled
specially for symbols inside shared libraries.  This is especially
visible when calling malloc, which happens everytime memory needs to
be allocated in inferior memory...  The special treatment included
again the necessity to use some routines only available on the host.
So another target object TARGET_OBJECT_HPUX_SOLIB_GOT was created for
that purpose.

gdb/ChangeLog:

        * ia64-tdep.h (struct regcache): Forward declare.
        (struct ia64_infcall_ops): New struct type.
        (struct gdbarch_tdep): New fields "find_global_pointer_from_solib"
        and "infcall_ops".
        * ia64-tdep.c (ia64_find_global_pointer_from_dynamic_section):
        Renames ia64_find_global_pointer.
        (ia64_find_global_pointer, ia64_allocate_new_rse_frame)
        (ia64_store_argument_in_slot, ia64_set_function_addr: New function.
        (ia64_push_dummy_call): Adjust to use the new tdep ia64_infocall_ops
        methods.
        (ia64_infcall_ops): New static global constant.
        (ia64_gdbarch_init): Set tdep->infcall_ops.
        * ia64-hpux-nat.c (ia64_hpux_xfer_solib_got): New function.
        (ia64_hpux_xfer_partial): Add TARGET_OBJECT_HPUX_SOLIB_GOT handing.
        * ia64-hpux-tdep.c: Include "regcache.h", "gdbcore.h" and "inferior.h".
        (ia64_hpux_dummy_code): New static global constant.
        (ia64_hpux_push_dummy_code, ia64_hpux_allocate_new_rse_frame)
        (ia64_hpux_store_argument_in_slot, ia64_hpux_set_function_addr)
        (ia64_hpux_dummy_id, ia64_hpux_find_global_pointer_from_solib):
        New function.
        (ia64_hpux_infcall_ops): New static global constant.
        (ia64_hpux_init_abi): Install gdbarch and tdep methods needed
        for inferior function calls to work properly on ia64-hpux.
2011-01-13 16:24:42 +00:00
Joel Brobecker 77ca787b12 [ia64-hpux] unwinding bsp value from system call
This fixes unwinding from a thread that is stopped inside a system call.
This can be seen when switching to a thread that is stopped doing a
pthread_cond_wait, for instance...

The comments inside the code should explain what is happening in our
case (the HP-UX exception in the case of system calls): Under certain
circumstances (program stopped inside syscall), the offset to apply to
the current BSP in order to compute the previous BSP is not the usual
CFM & 0x7f.

We parts in this patch:

  1. Figuring out that we are stopped inside a syscal: This requires
     a TT_LWP_RUREGS ttrace call, which is not directly possible from
     ia64-tdep.c.  So use defined a new TARGET_OBJECT_HPUX_UREGS object
     to request it from the -nat side.

  2. Add a gdbarch_tdep method that allows us to change the default
     behavior on ia64-hpux, permitting us to have a different "size of
     register frame" in that one particular case.

gdb/ChangeLog:

        * target.h (enum target_object): Add TARGET_OBJECT_HPUX_UREGS.
        * ia64-tdep.h (struct frame_info): forward declaration.
        (struct gdbarch_tdep): Add field size_of_register_frame.
        * ia64-tdep.c (ia64_access_reg): Use tdep->size_of_register_frame
        to determine the size of the register frame.
        (ia64_size_of_register_frame): New function.
        (ia64_gdbarch_init): Set tdep->size_of_register_frame.
        * ia64-hpux-tdep.c: Include "target.h" and "frame.h".
        (IA64_HPUX_UREG_REASON): New macro.
        (ia64_hpux_stopped_in_syscall, ia64_hpux_size_of_register_frame):
        New functions.
        (ia64_hpux_init_abi): Set tdep->size_of_register_frame.
        * ia64-hpux-nat.c (ia64_hpux_xfer_uregs): New function.
        (ia64_hpux_xfer_partial): Add handling of TARGET_OBJECT_HPUX_UREGS
        objects.
2011-01-13 16:24:27 +00:00
Joel Brobecker 92c9a4639b port GDB to ia64-hpux (native).
ChangeLog:

        * configure.ac: Remove readline, mmalloc, and gdb from noconfigdirs
        for ia64-hpux.
        * configure: Regenerate.

gdb/ChangeLog:

        * config/ia64/hpux.mh, ia64-hpux-nat.c, ia64-hpux-tdep.c,
        ia64-hpux-tdep.h, solib-ia64-hpux.c, solib-ia64-hpux.h: New files.

        * configure.host: Add handling for ia64-hpux hosts.  Add associated
        floatformats.
        * configure.tgt: Add handling for ia64-hpux targets.
        * Makefile.in (ALL_64_TARGET_OBS): Add ia64-hpux-tdep.o.
        (HFILES_NO_SRCDIR): Add ia64-hpux-tdep.h.
        (ALLDEPFILES): Add ia64-hpux-nat.c ia64-hpux-tdep.c.
2011-01-13 16:24:13 +00:00
Joel Brobecker f688d93f0b [hpux/ttrace] Determine attached process LWP immediately after attaching.
When attaching to a process, the ttrace interface was creating a ptid
with a null LWP, because it did not have it yet.  This LWP was then
set as soon as we received our first event from our inferior, during
our first wait.  Similarly, the allocation of the thread private info
was also defered.

This works on PA/HP-UX, because we immediately perform a wait to pop
the event triggered by the attach.  We can use that event to extract
the thread's LWP.  But this does not work for IA64/HP-UX, because
the attach no longer triggers an event, and thus a wait should NOT
be performed (such a wait would simply block indefinitely).

It is actually possible, however, to determine the thread's LWP.
This change therefore adjusts the attach code to create a thread with
the correct LWP set, as well as with its private info allocated.
Same thing for all the other threads.

gdb/ChangeLog:

        [ttrace] Compute thread list immediately after attach.
        * inf_ttrace_attach (inf_ttrace_create_threads_after_attach):
        New subprogram.
        (inf_ttrace_attach): Use it.
2011-01-13 16:23:33 +00:00
Joel Brobecker 1b89e62fe3 [libunwind-frame] handle functions with no minimal symbol/debug info.
This is something that I am seeing on ia64-hpux while trying to
backtrace from a thread that's doing a wait:

    (gdb) task 2
    [Switching to task 2]
    0x9fffffffef52f590 in __ksleep () from /[...]/libc.so.1
    (gdb) bt
    #0  0x9fffffffef52f590 in __ksleep () from /[...]/libc.so.1
    #1  0x9fffffffef73c870 in __sleep_1x1 () from /[...]/libpthread.so.1
    #2  0x9fffffffef738fe0 in __mxn_sleep () from /[...]/libpthread.so.1
    #3  0x9fffffffef675e90 in ?? () from /[...]/libpthread.so.1

The backtrace is incomplete and stops at frame #3, but there are in fact
a few more frames.

The reason why we stopped the backtrace is related to the fact that
we were not able to determine the start address of the function
corresponding to the frame PC.  This is visible at the user level
thanks to the "??" that GDB displayed for frame 3.

We have the following code in libunwind-frame.c:libunwind_frame_cache
which explicitly returns a NULL cache when we couldn't determine the
frame's function address, immediately triggering an end-of-stack
frame_id, thus terminating the backtrace:

   /* We can assume we are unwinding a normal frame.  Even if this is
      for a signal trampoline, ia64 signal "trampolines" use a normal
      subroutine call to start the signal handler.  */
   cache->func_addr = get_frame_func (this_frame);
   if (cache->func_addr == 0
       && get_next_frame (this_frame)
       && get_frame_type (get_next_frame (this_frame)) == NORMAL_FRAME)
     return NULL;

As explained in the comment, I think we can still go on, and use
the unwind record to do the debugging.  This change imlements this
change, and allows us to get the full backtrace.

gdb/ChangeLog:

        * libunwind-frame.c (libunwind_frame_cache): Do not return NULL
        if we could not determine the frame's function address.  Instead,
        use the frame's PC, and then continue.
2011-01-13 16:23:22 +00:00
Joel Brobecker 3e5e6e2ab5 Make sure __LITTLE_ENDIAN/__BIG_ENDIAN are defined in libunwind-frame.c
These macros do not seem to exist on ia64-hpux.

gdb/ChangeLog:

        * libunwind-frame.c (__LITTLE_ENDIAN, __BIG_ENDIAN): Define if
        not already defined.
2011-01-13 16:23:11 +00:00
Joel Brobecker 825d6d8a69 [ia64] small integral parameters and return values
This patch fixes a small problem on ia64-hpux when calling functions
whose parameter are small integral values (less than 8 bytes).  In
that case, the parameter value was stored on the wrong side of the
register.  Same problem for return values.

With this patch, the results for gdb.base/callfuncs.exp improve from

        # of expected passes            41
        # of unexpected failures        78

To:

        # of expected passes            95
        # of unexpected failures        24

gdb/ChangeLog:

        * ia64-tdep.c (ia64_struct_type_p): New function.
        (ia64_extract_return_value): Handle integral values that are
        less than 8 bytes long.
        (ia64_push_dummy_call): Likewise.
2011-01-13 16:23:00 +00:00
Joel Brobecker 7458e66756 [ia64] Add a big-endian version of the ia64-ext floatformat
ia64-tdep.c defines a floatformats_ia64_ext that should contain
both the little-endian and the big-endian version of the float
format used in the ia64 registers (an 82bit float format).
Right now, both entries point to the same little-endian definition.

A big-endian definition is now necessary for the ia64-hpux port.

gdb/ChangeLog:

        * ia64-tdep.c (floatformat_ia64_ext_little): Renames
        floatformat_ia64_ext.
        (floatformat_ia64_ext_big): New static const.
        (floatformats_ia64_ext): Set first entry to &floatformat_ia64_ext_big.
2011-01-13 16:22:48 +00:00
gdbadmin 15b8ba7693 *** empty log message *** 2011-01-13 00:00:03 +00:00
Tom Tromey 1b05df007b gdb
* mi/mi-symbol-cmds.c (mi_cmd_symbol_list_lines): Fix error
	messages.
	* mi/mi-main.c (mi_cmd_thread_select): Fix error messages.
	(mi_cmd_thread_list_ids): Likewise.
	(mi_cmd_data_list_changed_registers): Likewise.
	(mi_cmd_data_list_register_values): Likewise.
	(mi_cmd_data_write_register_values): Likewise.
	(mi_cmd_data_evaluate_expression): Likewise.
	(mi_cmd_data_read_memory): Likewise.
	(mi_cmd_data_read_memory_bytes): Likewise.
	(mi_cmd_data_write_memory): Likewise.
	(mi_cmd_enable_timings): Likewise.
	* mi/mi-interp.c (mi_cmd_interpreter_exec): Fix error messages.
	* mi/mi-cmd-var.c (mi_cmd_var_create): Fix error messages.
	(mi_cmd_var_delete): Likewise.
	(mi_cmd_var_set_format): Likewise.
	(mi_cmd_var_show_format): Likewise.
	(mi_cmd_var_info_num_children): Likewise.
	(mi_cmd_var_list_children): Likewise.
	(mi_cmd_var_info_type): Likewise.
	(mi_cmd_var_info_expression): Likewise.
	(mi_cmd_var_show_attributes): Likewise.
	(mi_cmd_var_assign): Likewise.
	(mi_cmd_var_update): Likewise.
	(mi_cmd_enable_pretty_printing): Likewise.
	(mi_cmd_var_set_update_range): Likewise.
	* mi/mi-cmd-target.c (mi_cmd_target_file_get): Fix error
	messages.
	(mi_cmd_target_file_put): Likewise.
	(mi_cmd_target_file_delete): Likewise.
	* mi/mi-cmd-stack.c (mi_cmd_stack_list_frames): Fix error
	messages.
	(mi_cmd_stack_info_depth): Likewise.
	(mi_cmd_stack_list_locals): Likewise.
	(mi_cmd_stack_list_args): Likewise.
	(mi_cmd_stack_select_frame): Likewise.
	(mi_cmd_stack_select_frame): Likewise.
	(mi_cmd_stack_info_frame): Likewise.
	* mi/mi-cmd-file.c (mi_cmd_file_list_exec_source_file): Fix error
	messages.
	(mi_cmd_file_list_exec_source_files): Likewise.
	* mi/mi-cmd-env.c (mi_cmd_env_pwd): Fix error messages.
	(mi_cmd_env_cd): Likewise.
	(mi_cmd_env_path): Likewise.
	(mi_cmd_env_dir): Likewise.
	(mi_cmd_inferior_tty_show): Likewise.
	* mi/mi-cmd-disas.c (mi_cmd_disassemble): Fix error messages.
	* mi/mi-cmd-break.c (mi_cmd_break_insert): Fix error messages.
	(mi_cmd_break_watch): Likewise.
gdb/testsuite
	* gdb.mi/gdb2549.exp: Update for error message changes.
	* gdb.mi/mi-cli.exp: Likewise.
	* gdb.mi/mi-disassemble.exp: Likewise.
	* gdb.mi/mi-pthreads.exp: Likewise.
	* gdb.mi/mi-regs.exp: Likewise.
	* gdb.mi/mi-stack.exp: Likewise.
	* gdb.mi/mi-var-block.exp: Likewise.
	* gdb.mi/mi-var-cmd.exp: Likewise.
	* gdb.mi/mi2-cli.exp: Likewise.
	* gdb.mi/mi2-disassemble.exp: Likewise.
	* gdb.mi/mi2-pthreads.exp: Likewise.
	* gdb.mi/mi2-regs.exp: Likewise.
	* gdb.mi/mi2-stack.exp: Likewise.
	* gdb.mi/mi2-var-block.exp: Likewise.
	* gdb.mi/mi2-var-cmd.exp: Likewise.
2011-01-12 21:09:39 +00:00
Thiago Jung Bauermann ad422571bd 2011-01-12 Thiago Jung Bauermann <bauerman@br.ibm.com>
* ppc-linux-nat.c (booke_cmp_hw_point): Fix whitespace.
	(ppc_linux_insert_hw_breakpoint): Likewise.
	(ppc_linux_remove_hw_breakpoint): Likewise.
	(ppc_linux_insert_watchpoint): Likewise.
2011-01-12 20:09:53 +00:00