Andrew Cagney | 1 Jun 2003 03:38
Picon
Favicon

[commit] Make MIPS set_reg_offset explicit

Hello,

This patch cleans up a little bit of the MIPS frame find saved regs code:

- adds a explicit parameter to set_reg_offset.
- eliminates a redundant wrapper function.

committed,
Andrew
2003-05-31  Andrew Cagney  <cagney <at> redhat.com>

	* mips-tdep.c (set_reg_offset): Add saved_regs parameter.  Add
	forward declaration.
	(mips16_heuristic_proc_desc): Pass temp_saved_regs.
	(mips16_heuristic_proc_desc): Pass temp_saved_regs.
	(mips_find_saved_regs): Use set_reg_offset.
	(mips_frame_init_saved_regs): Delete function.
	(mips_pop_frame): Call mips_find_saved_regs instead of
	DEPRECATED_FRAME_INIT_SAVED_REGS.

Index: mips-tdep.c
===================================================================
RCS file: /cvs/src/src/gdb/mips-tdep.c,v
retrieving revision 1.204
diff -u -r1.204 mips-tdep.c
--- mips-tdep.c	31 May 2003 22:56:29 -0000	1.204
+++ mips-tdep.c	1 Jun 2003 01:26:58 -0000
 <at>  <at>  -48,6 +48,8  <at>  <at> 
(Continue reading)

Richard Henderson | 1 Jun 2003 05:36
Picon
Favicon

dwarf2-frame clobbers memory

At the following traceback, memmove is overwriting the "help"
command, which results in a segv on the next command.  Is this
enough to track down the problem?

Target is alpha-linux.

r~

Watchpoint 4: *$16

Old value = 0x1202a70ff "help"
New value = 0x0
0x00000200001d7e0c in memmove () from /lib/libc.so.6.1
(top-gdb) where
#0  0x00000200001d7e0c in memmove () from /lib/libc.so.6.1
#1  0x00000001201e1a64 in execute_cfa_program (
    insn_ptr=0x1204359d0 " Ï< \001",
    insn_end=0x10000001b <Address 0x10000001b out of bounds>, next_frame=0x18,
    fs=0x2) at ../../../src-binu/gdb/dwarf2-frame.c:298
#2  0x00000001201e1a64 in execute_cfa_program (
    insn_ptr=0x1203ff670 "D\f\017\020", insn_end=0x1203ff678 "",
    next_frame=0x1203ba450, fs=0x1204359d0)
    at ../../../src-binu/gdb/dwarf2-frame.c:298
#3  0x00000001201e25ac in dwarf2_frame_cache (next_frame=0x1203ba450,
    this_cache=0x1203ba508) at ../../../src-binu/gdb/dwarf2-frame.c:518
#4  0x00000001201e2838 in dwarf2_frame_this_id (next_frame=0x1203ba450,
    this_cache=0x1203ba508, this_id=0x1203ba540)
    at ../../../src-binu/gdb/dwarf2-frame.c:567
#5  0x0000000120162928 in get_frame_id (fi=0x1203ba4e8)
    at ../../../src-binu/gdb/frame.c:243
(Continue reading)

Richard Henderson | 1 Jun 2003 05:48

[RFA] enable dwarf2 unwinder for alpha

Ok?

r~

	* alpha-linux-tdep.c (alpha_linux_init_abi): Install dwarf2 unwinder.

Index: alpha-linux-tdep.c
===================================================================
RCS file: /cvs/src/src/gdb/alpha-linux-tdep.c,v
retrieving revision 1.10
diff -c -p -d -r1.10 alpha-linux-tdep.c
*** alpha-linux-tdep.c	29 May 2003 23:02:53 -0000	1.10
--- alpha-linux-tdep.c	1 Jun 2003 03:39:03 -0000
***************
*** 20,29 ****

  #include "defs.h"
  #include "frame.h"
  #include "gdbcore.h"
- #include "value.h"
- #include "osabi.h"
  #include "gdb_assert.h"

  #include "alpha-tdep.h"

--- 20,34 ----

  #include "defs.h"
  #include "frame.h"
+ #include "frame-base.h"
(Continue reading)

Adam Fedor | 1 Jun 2003 05:52

[Ping/RFA]: ObjC Documentation

This patch hasn't been reviewed yet:

http://sources.redhat.com/ml/gdb-patches/2003-04/msg00542.htm

Adam Fedor wrote:
> 
> ------------------------------------------------------------------------
> 
> 2003-04-29  Adam Fedor  <fedor <at> gnu.org>
> 
> 	* gdb.texinfo: Add Objective-C documentation.
> 

Richard Henderson | 1 Jun 2003 05:57

[RFA] update alpha for push_dummy_call

Ok?

r~

	* alpha-tdep.c (alpha_push_dummy_call): Transmography from
	alpha_push_arguments.  Don't dump argument register data to
	the target stack.  Fix float and 128-bit long double semantics.
	Store $t12 and $ra as specified by the ABI.  Use regcache everywhere.
	(alpha_fix_call_dummy): Remove.
	(alpha_call_dummy_words): Remove.
	(alpha_gdbarch_init): Kill deprecated call hooks; add push_dummy_call.

Index: alpha-tdep.c
===================================================================
RCS file: /cvs/src/src/gdb/alpha-tdep.c,v
retrieving revision 1.88
diff -c -p -d -r1.88 alpha-tdep.c
*** alpha-tdep.c	31 May 2003 00:27:45 -0000	1.88
--- alpha-tdep.c	1 Jun 2003 03:39:04 -0000
*************** alpha_register_convert_to_raw (struct ty
*** 173,210 ****

  
  /* The alpha passes the first six arguments in the registers, the rest on
!    the stack. The register arguments are eventually transferred to the
!    argument transfer area immediately below the stack by the called function
!    anyway. So we `push' at least six arguments on the stack, `reload' the
!    argument registers and then adjust the stack pointer to point past the
!    sixth argument. This algorithm simplifies the passing of a large struct
!    which extends from the registers to the stack.
(Continue reading)

Adam Fedor | 1 Jun 2003 06:02

Re: [RFA]: gdbarch FETCH_POINTER_ARGUMENT


Andrew Cagney wrote:
> 
>> Here's an updated patch. The more I looked at the "struct type *type" 
>> argument, the less I understood about how it should be used. I assume 
>> it would only be used, so far, on i386, but I'm easily confused by 
>> stacks and registers (and how things are stored there), so any 
>> pointers would be appreciated.
> 
> 
> The patch is almost fine.  Change it to `F' instead of `f' - so that a 
> predicate is also available.
> 

OK, I made this change.
2003-05-18  Adam Fedor  <fedor <at> gnu.org>

        * gdbarch.sh (function_list): Add FETCH_POINTER_ARGUMENT.
        * gdbarch.[ch]: Regenerate.
        * hppa-tdep.c (hppa_fetch_pointer_argument): New function.
        (hppa_gdbarch_init): Set it in the gdbarch vector.
        * i386-tdep.c (i386_fetch_pointer_argument): New
        (i386_gdbarch_init): Set it into gdbarch.
        * rs6000-tdep.c (rs6000_fetch_pointer_argument): New.
        (rs6000_gdbarch_init): Set it in gdbarch.
        * sparc-tdep.c (sparc_fetch_pointer_argument): New
        (sparc_gdbarch_init): Set it in gdbarch.

(Continue reading)

Richard Henderson | 1 Jun 2003 08:07

[RFA] skip fde augmentation

Found by inspection.

I assume that the bulk of the dwarf2 testing has been done
on C code.  C++ code that handles exceptions would wind up
executing bogus CFA opcodes.

Ok?

r~

	* dwarf2-frame.c (struct dwarf2_cie): Add saw_z_augmentation.
	(decode_frame_entry): Set it.  Skip FDE augmentation.

--- dwarf2-frame.c.orig	2003-05-31 22:23:54.000000000 -0700
+++ dwarf2-frame.c	2003-05-31 22:30:21.000000000 -0700
 <at>  <at>  -65,6 +65,9  <at>  <at>  struct dwarf2_cie
   /* Encoding of addresses.  */
   unsigned char encoding;

+  /* True if a 'z' augmentation existed.  */
+  unsigned char saw_z_augmentation;
+
   struct dwarf2_cie *next;
 };

 <at>  <at>  -1111,7 +1114,8  <at>  <at>  decode_frame_entry (struct comp_unit *un
       cie->return_address_register = read_1_byte (unit->abfd, buf);
       buf += 1;

-      if (*augmentation == 'z')
(Continue reading)

Joel Brobecker | 1 Jun 2003 08:33

[RFA] Fix memory corruption when writting in inferior memory

Hello,

This occurs on AiX (4.3.2 or 5.1). The case that we came across was with
an Ada program that contains a function with a string as a parameter.
We noticed that the string was not always correctly passed when the
function was called from GDB. For instance, we saw:

   (gdb) call trace ("1234567890")
   Trace_Message:
   (gdb)

But we expected:

   (gdb) call trace ("1234567890")
   Trace_Message: 1234567890
   (gdb)

Contrary to C, our Ada-mode no longer uses malloc() to allocate some
memory for the string, but rather pushes the string on the stack.
As you may have noticed, the string length is not a multiple of 4.

A string in Ada is an array of characters. Arrays in Ada is actually
fat pointers, that is a structure containings 2 fields: the first field
is a pointer to the array, and the second field is a pointer to a
structure containing the 2 bounds.

In C parlance, a string would be defined like this:

   struct { int UB0; int LB0; } string___XUB;
   struct { char *P_ARRAY; struct string___XUB *P_BOUNDS; } string;
(Continue reading)

Joel Brobecker | 1 Jun 2003 09:01

[RFA] Fix libiberty compilation failure on systems running AiX 4.x

Hello,

The following change in libiberty works for Aix 5.x, but breaks the
build on AiX 4.x:

        2003-02-22  Kaveh R. Ghazi  <ghazi <at> caip.rutgers.edu>

                * configure.in: Check for sys/systemcfg.h and
                _system_configuration.
                * physmem.c: Add support for AIX.  Tweek formatting as per
                upstream coreutils beta.

This is because the _system_configuration structure does not contain
a field named "physmem", which is used in physmem.c:

        #if HAVE__SYSTEM_CONFIGURATION
          /* This works on AIX.  */
          return _system_configuration.physmem;
        #endif

For the record, I have pasted at then end of this message the definition
of this varible on a machine running 4.3.2 .

Given that the only field in _system_configuration used is "physmem",
the attached patch seemed to be the simplest change to get back the
build on AiX 4.x machines. I essentially deactivated the test for
_system_configuration on machines running AiX 4.x.

2003-06-01  J. Brobecker  <brobecker <at> gnat.com>

(Continue reading)

Richard Henderson | 1 Jun 2003 09:02

[RFA] fix maint space

Seems awfully dangerous to depend on environ living at some
specific address.  Indeed, for alpha-linux it lives in libc.so.

It would seem more robust to either

  (1) Just cache the brk at the beginning of execution.
  (2) Use a special statistics routine provided by the
      malloc implementation, since the heap may be split
      into discontiguous pieces.

Here I do the former.  Ok?

r~

	* top.h (lim_at_start): Declare.
	* main.c (captured_main): Set it.
	* top.c (lim_at_start): Define.
	(command_loop): Use it instead of &environ.
	* event-top.c (command_handler): Likewise.

Index: event-top.c
===================================================================
RCS file: /cvs/src/src/gdb/event-top.c,v
retrieving revision 1.26
diff -c -p -d -u -r1.26 event-top.c
--- event-top.c	12 Feb 2003 15:31:30 -0000	1.26
+++ event-top.c	1 Jun 2003 06:56:23 -0000
 <at>  <at>  -492,10 +492,8  <at>  <at>  command_handler (char *command)
   if (display_space)
     {
(Continue reading)


Gmane