This commit is contained in:
parent
2100ce0800
commit
9712638660
@ -1,60 +0,0 @@
|
||||
2007-03-15 Andreas Schwab <schwab@suse.de>
|
||||
|
||||
* ppc-linux-tdep.c (ppc_linux_return_value): Vectors are returned
|
||||
in general registers.
|
||||
|
||||
--- gdb/ppc-linux-tdep.c
|
||||
+++ gdb/ppc-linux-tdep.c
|
||||
@@ -484,17 +484,47 @@
|
||||
/* For historic reasons, PPC 32 GNU/Linux follows PowerOpen rather
|
||||
than the 32 bit SYSV R4 ABI structure return convention - all
|
||||
structures, no matter their size, are put in memory. Vectors,
|
||||
- which were added later, do get returned in a register though. */
|
||||
+ which were added later, do get returned in a register, although
|
||||
+ not in an AltiVec register. */
|
||||
|
||||
static enum return_value_convention
|
||||
ppc_linux_return_value (struct gdbarch *gdbarch, struct type *valtype,
|
||||
struct regcache *regcache, gdb_byte *readbuf,
|
||||
const gdb_byte *writebuf)
|
||||
{
|
||||
- if ((TYPE_CODE (valtype) == TYPE_CODE_STRUCT
|
||||
- || TYPE_CODE (valtype) == TYPE_CODE_UNION)
|
||||
- && !((TYPE_LENGTH (valtype) == 16 || TYPE_LENGTH (valtype) == 8)
|
||||
- && TYPE_VECTOR (valtype)))
|
||||
+ struct gdbarch_tdep *tdep = gdbarch_tdep (gdbarch);
|
||||
+
|
||||
+ if (TYPE_LENGTH (valtype) == 16
|
||||
+ && TYPE_CODE (valtype) == TYPE_CODE_ARRAY
|
||||
+ && TYPE_VECTOR (valtype))
|
||||
+ {
|
||||
+ /* Return value is in r3-r6. */
|
||||
+ if (readbuf)
|
||||
+ {
|
||||
+ regcache_cooked_read (regcache, tdep->ppc_gp0_regnum + 3,
|
||||
+ readbuf + 0);
|
||||
+ regcache_cooked_read (regcache, tdep->ppc_gp0_regnum + 4,
|
||||
+ readbuf + 4);
|
||||
+ regcache_cooked_read (regcache, tdep->ppc_gp0_regnum + 5,
|
||||
+ readbuf + 8);
|
||||
+ regcache_cooked_read (regcache, tdep->ppc_gp0_regnum + 6,
|
||||
+ readbuf + 12);
|
||||
+ }
|
||||
+ if (writebuf)
|
||||
+ {
|
||||
+ regcache_cooked_write (regcache, tdep->ppc_gp0_regnum + 3,
|
||||
+ writebuf + 0);
|
||||
+ regcache_cooked_write (regcache, tdep->ppc_gp0_regnum + 4,
|
||||
+ writebuf + 4);
|
||||
+ regcache_cooked_write (regcache, tdep->ppc_gp0_regnum + 5,
|
||||
+ writebuf + 8);
|
||||
+ regcache_cooked_write (regcache, tdep->ppc_gp0_regnum + 6,
|
||||
+ writebuf + 12);
|
||||
+ }
|
||||
+ return RETURN_VALUE_REGISTER_CONVENTION;
|
||||
+ }
|
||||
+ else if (TYPE_CODE (valtype) == TYPE_CODE_STRUCT
|
||||
+ || TYPE_CODE (valtype) == TYPE_CODE_UNION)
|
||||
return RETURN_VALUE_STRUCT_CONVENTION;
|
||||
else
|
||||
return ppc_sysv_abi_return_value (gdbarch, valtype, regcache, readbuf,
|
@ -1,574 +0,0 @@
|
||||
20006-06-22 Paul Gilliam <pgilliam@us.ibm.com>
|
||||
|
||||
* gdbarch.sh: Change the return type of software_single_step from
|
||||
void to int and reformatted some comments to <= 80 columns.
|
||||
* gdbarch.c, gdbarch.h: Regenerated.
|
||||
* alpha-tdep.c (alpha_software_single_step): Change the return type
|
||||
from void to int and always return 1.
|
||||
* alpha-tdep.h: Change the return type of alpha_software_single_step
|
||||
from void to int.
|
||||
* arm-tdep.c (arm_software_single_step): Change the return type from
|
||||
void to int and always return 1.
|
||||
* cris-tdep.c (cris_software_single_step): Change the return type
|
||||
from void to int and always return 1.
|
||||
* mips-tdep.c (mips_software_single_step): Change the return type
|
||||
from void to int and always return 1.
|
||||
* mips-tdep.h: Change the return type of mips_software_single_step
|
||||
from void to int.
|
||||
* rs6000-tdep.c (rs6000_software_single_step): Change the return type
|
||||
from void to int and always return 1.
|
||||
*rs6000-tdep.h: Change the return type of rs6000_software_single_step
|
||||
from void to int.
|
||||
* sparc-tdep.c (sparc_software_single_step): Change the return type
|
||||
from void to int and always return 1.
|
||||
* sparc-tdep.h: Change the return type of sparc_software_single_step
|
||||
from void to int.
|
||||
* wince.c (wince_software_single_step {three times}): Change the
|
||||
return type from void to int and always return 1.
|
||||
infrun.c (resume): Check the return value from SOFTWARE_SINGLE_STEP
|
||||
and act accordingly. True means that the software_single_step
|
||||
breakpoints where inserted; false means they where not.
|
||||
|
||||
Index: alpha-tdep.c
|
||||
===================================================================
|
||||
--- alpha-tdep.c.orig
|
||||
+++ alpha-tdep.c
|
||||
@@ -1510,7 +1510,7 @@ alpha_next_pc (CORE_ADDR pc)
|
||||
return (pc + 4);
|
||||
}
|
||||
|
||||
-void
|
||||
+int
|
||||
alpha_software_single_step (enum target_signal sig, int insert_breakpoints_p)
|
||||
{
|
||||
static CORE_ADDR next_pc;
|
||||
@@ -1528,6 +1528,7 @@ alpha_software_single_step (enum target_
|
||||
remove_single_step_breakpoints ();
|
||||
write_pc (next_pc);
|
||||
}
|
||||
+ return 1;
|
||||
}
|
||||
|
||||
|
||||
Index: alpha-tdep.h
|
||||
===================================================================
|
||||
--- alpha-tdep.h.orig
|
||||
+++ alpha-tdep.h
|
||||
@@ -107,7 +107,7 @@ struct gdbarch_tdep
|
||||
};
|
||||
|
||||
extern unsigned int alpha_read_insn (CORE_ADDR pc);
|
||||
-extern void alpha_software_single_step (enum target_signal, int);
|
||||
+extern int alpha_software_single_step (enum target_signal, int);
|
||||
extern CORE_ADDR alpha_after_prologue (CORE_ADDR pc);
|
||||
|
||||
extern void alpha_mdebug_init_abi (struct gdbarch_info, struct gdbarch *);
|
||||
Index: arm-tdep.c
|
||||
===================================================================
|
||||
--- arm-tdep.c.orig
|
||||
+++ arm-tdep.c
|
||||
@@ -1840,7 +1840,7 @@ arm_get_next_pc (CORE_ADDR pc)
|
||||
single_step() is also called just after the inferior stops. If we
|
||||
had set up a simulated single-step, we undo our damage. */
|
||||
|
||||
-static void
|
||||
+static int
|
||||
arm_software_single_step (enum target_signal sig, int insert_bpt)
|
||||
{
|
||||
/* NOTE: This may insert the wrong breakpoint instruction when
|
||||
@@ -1855,6 +1855,8 @@ arm_software_single_step (enum target_si
|
||||
}
|
||||
else
|
||||
remove_single_step_breakpoints ();
|
||||
+
|
||||
+ return 1
|
||||
}
|
||||
|
||||
#include "bfd-in2.h"
|
||||
Index: cris-tdep.c
|
||||
===================================================================
|
||||
--- cris-tdep.c.orig
|
||||
+++ cris-tdep.c
|
||||
@@ -2117,7 +2117,7 @@ find_step_target (inst_env_type *inst_en
|
||||
digs through the opcodes in order to find all possible targets.
|
||||
Either one ordinary target or two targets for branches may be found. */
|
||||
|
||||
-static void
|
||||
+static int
|
||||
cris_software_single_step (enum target_signal ignore, int insert_breakpoints)
|
||||
{
|
||||
inst_env_type inst_env;
|
||||
@@ -2150,6 +2150,8 @@ cris_software_single_step (enum target_s
|
||||
}
|
||||
else
|
||||
remove_single_step_breakpoints ();
|
||||
+
|
||||
+ return 1;
|
||||
}
|
||||
|
||||
/* Calculates the prefix value for quick offset addressing mode. */
|
||||
Index: gdbarch.c
|
||||
===================================================================
|
||||
--- gdbarch.c.orig
|
||||
+++ gdbarch.c
|
||||
@@ -3273,14 +3273,14 @@ gdbarch_software_single_step_p (struct g
|
||||
return gdbarch->software_single_step != NULL;
|
||||
}
|
||||
|
||||
-void
|
||||
+int
|
||||
gdbarch_software_single_step (struct gdbarch *gdbarch, enum target_signal sig, int insert_breakpoints_p)
|
||||
{
|
||||
gdb_assert (gdbarch != NULL);
|
||||
gdb_assert (gdbarch->software_single_step != NULL);
|
||||
if (gdbarch_debug >= 2)
|
||||
fprintf_unfiltered (gdb_stdlog, "gdbarch_software_single_step called\n");
|
||||
- gdbarch->software_single_step (sig, insert_breakpoints_p);
|
||||
+ return gdbarch->software_single_step (sig, insert_breakpoints_p);
|
||||
}
|
||||
|
||||
void
|
||||
Index: gdbarch.h
|
||||
===================================================================
|
||||
--- gdbarch.h.orig
|
||||
+++ gdbarch.h
|
||||
@@ -1140,14 +1140,16 @@ extern void set_gdbarch_smash_text_addre
|
||||
#define SMASH_TEXT_ADDRESS(addr) (gdbarch_smash_text_address (current_gdbarch, addr))
|
||||
#endif
|
||||
|
||||
-/* FIXME/cagney/2001-01-18: This should be split in two. A target method that indicates if
|
||||
- the target needs software single step. An ISA method to implement it.
|
||||
+/* FIXME/cagney/2001-01-18: This should be split in two. A target method that
|
||||
+ indicates if the target needs software single step. An ISA method to
|
||||
+ implement it.
|
||||
|
||||
- FIXME/cagney/2001-01-18: This should be replaced with something that inserts breakpoints
|
||||
- using the breakpoint system instead of blatting memory directly (as with rs6000).
|
||||
+ FIXME/cagney/2001-01-18: This should be replaced with something that inserts
|
||||
+ breakpoints using the breakpoint system instead of blatting memory directly
|
||||
+ (as with rs6000).
|
||||
|
||||
- FIXME/cagney/2001-01-18: The logic is backwards. It should be asking if the target can
|
||||
- single step. If not, then implement single step using breakpoints. */
|
||||
+ FIXME/cagney/2001-01-18: The logic is backwards. It should be asking if the
|
||||
+ target can single step. If not, then implement single step using breakpoints. */
|
||||
|
||||
#if defined (SOFTWARE_SINGLE_STEP)
|
||||
/* Legacy for systems yet to multi-arch SOFTWARE_SINGLE_STEP */
|
||||
@@ -1164,8 +1166,8 @@ extern int gdbarch_software_single_step_
|
||||
#define SOFTWARE_SINGLE_STEP_P() (gdbarch_software_single_step_p (current_gdbarch))
|
||||
#endif
|
||||
|
||||
-typedef void (gdbarch_software_single_step_ftype) (enum target_signal sig, int insert_breakpoints_p);
|
||||
-extern void gdbarch_software_single_step (struct gdbarch *gdbarch, enum target_signal sig, int insert_breakpoints_p);
|
||||
+typedef int (gdbarch_software_single_step_ftype) (enum target_signal sig, int insert_breakpoints_p);
|
||||
+extern int gdbarch_software_single_step (struct gdbarch *gdbarch, enum target_signal sig, int insert_breakpoints_p);
|
||||
extern void set_gdbarch_software_single_step (struct gdbarch *gdbarch, gdbarch_software_single_step_ftype *software_single_step);
|
||||
#if !defined (GDB_TM_FILE) && defined (SOFTWARE_SINGLE_STEP)
|
||||
#error "Non multi-arch definition of SOFTWARE_SINGLE_STEP"
|
||||
Index: gdbarch.sh
|
||||
===================================================================
|
||||
--- gdbarch.sh.orig
|
||||
+++ gdbarch.sh
|
||||
@@ -601,15 +601,19 @@ f:=:CORE_ADDR:addr_bits_remove:CORE_ADDR
|
||||
# It is not at all clear why SMASH_TEXT_ADDRESS is not folded into
|
||||
# ADDR_BITS_REMOVE.
|
||||
f:=:CORE_ADDR:smash_text_address:CORE_ADDR addr:addr::core_addr_identity::0
|
||||
-# FIXME/cagney/2001-01-18: This should be split in two. A target method that indicates if
|
||||
-# the target needs software single step. An ISA method to implement it.
|
||||
+
|
||||
+# FIXME/cagney/2001-01-18: This should be split in two. A target method that
|
||||
+# indicates if the target needs software single step. An ISA method to
|
||||
+# implement it.
|
||||
#
|
||||
-# FIXME/cagney/2001-01-18: This should be replaced with something that inserts breakpoints
|
||||
-# using the breakpoint system instead of blatting memory directly (as with rs6000).
|
||||
+# FIXME/cagney/2001-01-18: This should be replaced with something that inserts
|
||||
+# breakpoints using the breakpoint system instead of blatting memory directly
|
||||
+# (as with rs6000).
|
||||
#
|
||||
-# FIXME/cagney/2001-01-18: The logic is backwards. It should be asking if the target can
|
||||
-# single step. If not, then implement single step using breakpoints.
|
||||
-F:=:void:software_single_step:enum target_signal sig, int insert_breakpoints_p:sig, insert_breakpoints_p
|
||||
+# FIXME/cagney/2001-01-18: The logic is backwards. It should be asking if the
|
||||
+# target can single step. If not, then implement single step using breakpoints.
|
||||
+F:=:int:software_single_step:enum target_signal sig, int insert_breakpoints_p:sig, insert_breakpoints_p
|
||||
+
|
||||
# Return non-zero if the processor is executing a delay slot and a
|
||||
# further single-step is needed before the instruction finishes.
|
||||
M::int:single_step_through_delay:struct frame_info *frame:frame
|
||||
Index: infrun.c
|
||||
===================================================================
|
||||
--- infrun.c.orig
|
||||
+++ infrun.c
|
||||
@@ -557,13 +557,15 @@ resume (int step, enum target_signal sig
|
||||
if (SOFTWARE_SINGLE_STEP_P () && step)
|
||||
{
|
||||
/* Do it the hard way, w/temp breakpoints */
|
||||
- SOFTWARE_SINGLE_STEP (sig, 1 /*insert-breakpoints */ );
|
||||
- /* ...and don't ask hardware to do it. */
|
||||
- step = 0;
|
||||
- /* and do not pull these breakpoints until after a `wait' in
|
||||
- `wait_for_inferior' */
|
||||
- singlestep_breakpoints_inserted_p = 1;
|
||||
- singlestep_ptid = inferior_ptid;
|
||||
+ if (SOFTWARE_SINGLE_STEP (sig, 1 /*insert-breakpoints */ ))
|
||||
+ {
|
||||
+ /* ...and don't ask hardware to do it. */
|
||||
+ step = 0;
|
||||
+ /* and do not pull these breakpoints until after a `wait' in
|
||||
+ `wait_for_inferior' */
|
||||
+ singlestep_breakpoints_inserted_p = 1;
|
||||
+ singlestep_ptid = inferior_ptid;
|
||||
+ }
|
||||
}
|
||||
|
||||
/* If there were any forks/vforks/execs that were caught and are
|
||||
@@ -1382,7 +1384,7 @@ handle_inferior_event (struct execution_
|
||||
(LONGEST) ecs->ws.value.integer));
|
||||
gdb_flush (gdb_stdout);
|
||||
target_mourn_inferior ();
|
||||
- singlestep_breakpoints_inserted_p = 0; /*SOFTWARE_SINGLE_STEP_P() */
|
||||
+ singlestep_breakpoints_inserted_p = 0; /* SOFTWARE_SINGLE_STEP_P() */
|
||||
stop_print_frame = 0;
|
||||
stop_stepping (ecs);
|
||||
return;
|
||||
@@ -1402,7 +1404,7 @@ handle_inferior_event (struct execution_
|
||||
target_mourn_inferior ();
|
||||
|
||||
print_stop_reason (SIGNAL_EXITED, stop_signal);
|
||||
- singlestep_breakpoints_inserted_p = 0; /*SOFTWARE_SINGLE_STEP_P() */
|
||||
+ singlestep_breakpoints_inserted_p = 0; /* SOFTWARE_SINGLE_STEP_P() */
|
||||
stop_stepping (ecs);
|
||||
return;
|
||||
|
||||
@@ -1576,7 +1578,7 @@ handle_inferior_event (struct execution_
|
||||
if (debug_infrun)
|
||||
fprintf_unfiltered (gdb_stdlog, "infrun: stepping_past_singlestep_breakpoint\n");
|
||||
/* Pull the single step breakpoints out of the target. */
|
||||
- SOFTWARE_SINGLE_STEP (0, 0);
|
||||
+ (void) SOFTWARE_SINGLE_STEP (0, 0);
|
||||
singlestep_breakpoints_inserted_p = 0;
|
||||
|
||||
ecs->random_signal = 0;
|
||||
@@ -1640,7 +1642,7 @@ handle_inferior_event (struct execution_
|
||||
if (SOFTWARE_SINGLE_STEP_P () && singlestep_breakpoints_inserted_p)
|
||||
{
|
||||
/* Pull the single step breakpoints out of the target. */
|
||||
- SOFTWARE_SINGLE_STEP (0, 0);
|
||||
+ (void) SOFTWARE_SINGLE_STEP (0, 0);
|
||||
singlestep_breakpoints_inserted_p = 0;
|
||||
}
|
||||
|
||||
@@ -1713,7 +1715,7 @@ handle_inferior_event (struct execution_
|
||||
if (SOFTWARE_SINGLE_STEP_P () && singlestep_breakpoints_inserted_p)
|
||||
{
|
||||
/* Pull the single step breakpoints out of the target. */
|
||||
- SOFTWARE_SINGLE_STEP (0, 0);
|
||||
+ (void) SOFTWARE_SINGLE_STEP (0, 0);
|
||||
singlestep_breakpoints_inserted_p = 0;
|
||||
}
|
||||
|
||||
Index: mips-tdep.c
|
||||
===================================================================
|
||||
--- mips-tdep.c.orig
|
||||
+++ mips-tdep.c
|
||||
@@ -2185,7 +2185,7 @@ mips_addr_bits_remove (CORE_ADDR addr)
|
||||
single_step is also called just after the inferior stops. If we had
|
||||
set up a simulated single-step, we undo our damage. */
|
||||
|
||||
-void
|
||||
+int
|
||||
mips_software_single_step (enum target_signal sig, int insert_breakpoints_p)
|
||||
{
|
||||
CORE_ADDR pc, next_pc;
|
||||
@@ -2199,6 +2199,8 @@ mips_software_single_step (enum target_s
|
||||
}
|
||||
else
|
||||
remove_single_step_breakpoints ();
|
||||
+
|
||||
+ return 1;
|
||||
}
|
||||
|
||||
/* Test whether the PC points to the return instruction at the
|
||||
Index: mips-tdep.h
|
||||
===================================================================
|
||||
--- mips-tdep.h.orig
|
||||
+++ mips-tdep.h
|
||||
@@ -103,7 +103,7 @@ enum
|
||||
};
|
||||
|
||||
/* Single step based on where the current instruction will take us. */
|
||||
-extern void mips_software_single_step (enum target_signal, int);
|
||||
+extern int mips_software_single_step (enum target_signal, int);
|
||||
|
||||
/* Tell if the program counter value in MEMADDR is in a MIPS16
|
||||
function. */
|
||||
Index: rs6000-tdep.c
|
||||
===================================================================
|
||||
--- rs6000-tdep.c.orig
|
||||
+++ rs6000-tdep.c
|
||||
@@ -702,10 +702,98 @@ rs6000_breakpoint_from_pc (CORE_ADDR *bp
|
||||
return little_breakpoint;
|
||||
}
|
||||
|
||||
+#define LWARX_MASK 0xfc0007fe
|
||||
+#define LWARX_INSTRUCTION 0x7c000028
|
||||
+#define LDARX_INSTRUCTION 0x7c0000A8
|
||||
+#define STWCX_MASK 0xfc0007ff
|
||||
+#define STWCX_INSTRUCTION 0x7c00012d
|
||||
+#define STDCX_INSTRUCTION 0x7c0001ad
|
||||
+#define BC_MASK 0xfc000000
|
||||
+#define BC_INSTRUCTION 0x40000000
|
||||
+#define IMMEDIATE_PART(insn) (((insn & ~3) << 16) >> 16)
|
||||
+#define ABSOLUTE_P(insn) ((int) ((insn >> 1) & 1))
|
||||
+
|
||||
+static int
|
||||
+deal_with_atomic_sequence (enum target_signal sig, int insert_breakpoints_p)
|
||||
+{
|
||||
+ CORE_ADDR pc = read_pc ();
|
||||
+ CORE_ADDR breaks[2] = {-1, -1};
|
||||
+ CORE_ADDR loc = pc;
|
||||
+ int insn = read_memory_integer (loc, PPC_INSN_SIZE);
|
||||
+ int last_break = 0;
|
||||
+ int i;
|
||||
|
||||
-/* AIX does not support PT_STEP. Simulate it. */
|
||||
+ if (insert_breakpoints_p)
|
||||
+ {
|
||||
+
|
||||
+ /* Assume all atomic sequences start with an lwarx or ldarx instruction. */
|
||||
+ if ((insn & LWARX_MASK) != LWARX_INSTRUCTION
|
||||
+ && (insn & LWARX_MASK) != LDARX_INSTRUCTION)
|
||||
+ return 0;
|
||||
+
|
||||
+ /* Assume that no atomic sequence is longer than 6 instructions. */
|
||||
+ for (i = 1; i < 5; ++i)
|
||||
+ {
|
||||
+ loc += PPC_INSN_SIZE;
|
||||
+ insn = read_memory_integer (loc, PPC_INSN_SIZE);
|
||||
+
|
||||
+ /* Assume at most one conditional branch instruction between
|
||||
+ the lwarx and stwcx instructions.*/
|
||||
+ if ((insn & BC_MASK) == BC_INSTRUCTION)
|
||||
+ {
|
||||
+ last_break = 1;
|
||||
+ breaks[1] = IMMEDIATE_PART (insn);
|
||||
+ if ( ! ABSOLUTE_P(insn))
|
||||
+ breaks[1] += loc;
|
||||
+ continue;
|
||||
+ }
|
||||
|
||||
-void
|
||||
+ if ((insn & STWCX_MASK) == STWCX_INSTRUCTION
|
||||
+ || (insn & STWCX_MASK) == STDCX_INSTRUCTION)
|
||||
+ break;
|
||||
+ }
|
||||
+
|
||||
+ /* Assume that the atomic sequence ends with a stwcx instruction
|
||||
+ followed by a conditional branch instruction. */
|
||||
+ if ((insn & STWCX_MASK) != STWCX_INSTRUCTION
|
||||
+ && (insn & STWCX_MASK) != STDCX_INSTRUCTION)
|
||||
+ warning (_("Tried to step over an atomic sequence of instructions at %s\n \
|
||||
+ but could not find the end of the sequence."),
|
||||
+ core_addr_to_string(pc));
|
||||
+
|
||||
+ loc += PPC_INSN_SIZE;
|
||||
+ insn = read_memory_integer (loc, PPC_INSN_SIZE);
|
||||
+
|
||||
+ if ((insn & BC_MASK) != BC_INSTRUCTION)
|
||||
+ warning (_("Tried to step over an atomic sequence of instructions at %s\n \
|
||||
+ but the instruction sequence ended in an unexpected way."),
|
||||
+ core_addr_to_string(pc));
|
||||
+
|
||||
+ breaks[0] = loc;
|
||||
+
|
||||
+ /* This should never happen, but make sure we don't put
|
||||
+ two breakpoints on the same address. */
|
||||
+ if (last_break && breaks[1] == breaks[0])
|
||||
+ last_break = 0;
|
||||
+
|
||||
+ for (i = 0; i <= last_break; ++i)
|
||||
+ insert_single_step_breakpoint (breaks[i]);
|
||||
+
|
||||
+ printf_unfiltered (_("Stepping over an atomic sequence of instructions beginning at %s\n"),
|
||||
+ core_addr_to_string (pc));
|
||||
+
|
||||
+ gdb_flush (gdb_stdout);
|
||||
+ }
|
||||
+ else
|
||||
+ remove_single_step_breakpoints();
|
||||
+
|
||||
+ return 1;
|
||||
+}
|
||||
+
|
||||
+/* AIX does not support PT_STEP. Simulate it, dealing with any sequence of
|
||||
+ instructions that must be atomic. */
|
||||
+
|
||||
+int
|
||||
rs6000_software_single_step (enum target_signal signal,
|
||||
int insert_breakpoints_p)
|
||||
{
|
||||
@@ -723,6 +811,9 @@ rs6000_software_single_step (enum target
|
||||
|
||||
insn = read_memory_integer (loc, 4);
|
||||
|
||||
+ if (deal_with_atomic_sequence (signal, insert_breakpoints_p))
|
||||
+ return 1;
|
||||
+
|
||||
breaks[0] = loc + breakp_sz;
|
||||
opcode = insn >> 26;
|
||||
breaks[1] = branch_dest (opcode, insn, loc, breaks[0]);
|
||||
@@ -744,6 +835,8 @@ rs6000_software_single_step (enum target
|
||||
|
||||
errno = 0; /* FIXME, don't ignore errors! */
|
||||
/* What errors? {read,write}_memory call error(). */
|
||||
+
|
||||
+ return 1;
|
||||
}
|
||||
|
||||
|
||||
@@ -3500,6 +3593,9 @@ rs6000_gdbarch_init (struct gdbarch_info
|
||||
set_gdbarch_inner_than (gdbarch, core_addr_lessthan);
|
||||
set_gdbarch_breakpoint_from_pc (gdbarch, rs6000_breakpoint_from_pc);
|
||||
|
||||
+ /* Watch for locking instruction sequences during single stepping */
|
||||
+ set_gdbarch_software_single_step(gdbarch, deal_with_atomic_sequence);
|
||||
+
|
||||
/* Handle the 64-bit SVR4 minimal-symbol convention of using "FN"
|
||||
for the descriptor and ".FN" for the entry-point -- a user
|
||||
specifying "break FN" will unexpectedly end up with a breakpoint
|
||||
Index: rs6000-tdep.h
|
||||
===================================================================
|
||||
--- rs6000-tdep.h.orig
|
||||
+++ rs6000-tdep.h
|
||||
@@ -21,6 +21,6 @@
|
||||
|
||||
#include "defs.h"
|
||||
|
||||
-extern void rs6000_software_single_step (enum target_signal signal,
|
||||
- int insert_breakpoints_p);
|
||||
+extern int rs6000_software_single_step (enum target_signal signal,
|
||||
+ int insert_breakpoints_p);
|
||||
|
||||
Index: sparc-tdep.c
|
||||
===================================================================
|
||||
--- sparc-tdep.c.orig
|
||||
+++ sparc-tdep.c
|
||||
@@ -1131,7 +1131,7 @@ sparc_step_trap (unsigned long insn)
|
||||
return 0;
|
||||
}
|
||||
|
||||
-void
|
||||
+int
|
||||
sparc_software_single_step (enum target_signal sig, int insert_breakpoints_p)
|
||||
{
|
||||
struct gdbarch *arch = current_gdbarch;
|
||||
@@ -1161,6 +1161,8 @@ sparc_software_single_step (enum target_
|
||||
}
|
||||
else
|
||||
remove_single_step_breakpoints ();
|
||||
+
|
||||
+ return 1;
|
||||
}
|
||||
|
||||
static void
|
||||
Index: sparc-tdep.h
|
||||
===================================================================
|
||||
--- sparc-tdep.h.orig
|
||||
+++ sparc-tdep.h
|
||||
@@ -167,8 +167,8 @@ extern struct sparc_frame_cache *
|
||||
|
||||
|
||||
|
||||
-extern void sparc_software_single_step (enum target_signal sig,
|
||||
- int insert_breakpoints_p);
|
||||
+extern int sparc_software_single_step (enum target_signal sig,
|
||||
+ int insert_breakpoints_p);
|
||||
|
||||
extern void sparc_supply_rwindow (struct regcache *regcache,
|
||||
CORE_ADDR sp, int regnum);
|
||||
Index: wince.c
|
||||
===================================================================
|
||||
--- wince.c.orig
|
||||
+++ wince.c
|
||||
@@ -838,7 +838,7 @@ undoSStep (thread_info * th)
|
||||
}
|
||||
}
|
||||
|
||||
-void
|
||||
+int
|
||||
wince_software_single_step (enum target_signal ignore,
|
||||
int insert_breakpoints_p)
|
||||
{
|
||||
@@ -850,14 +850,15 @@ wince_software_single_step (enum target_
|
||||
if (!insert_breakpoints_p)
|
||||
{
|
||||
undoSStep (th);
|
||||
- return;
|
||||
+ return 1;
|
||||
}
|
||||
|
||||
th->stepped = 1;
|
||||
pc = read_register (PC_REGNUM);
|
||||
th->step_pc = mips_next_pc (pc);
|
||||
insert_single_step_breakpoint (th->step_pc);
|
||||
- return;
|
||||
+
|
||||
+ return 1;
|
||||
}
|
||||
#elif SHx
|
||||
/* Renesas SH architecture instruction encoding masks */
|
||||
@@ -979,7 +980,7 @@ undoSStep (thread_info * th)
|
||||
instruction and setting a breakpoint on the "next" instruction
|
||||
which would be executed. This code hails from sh-stub.c.
|
||||
*/
|
||||
-void
|
||||
+int
|
||||
wince_software_single_step (enum target_signal ignore,
|
||||
int insert_breakpoints_p)
|
||||
{
|
||||
@@ -989,13 +990,14 @@ wince_software_single_step (enum target_
|
||||
if (!insert_breakpoints_p)
|
||||
{
|
||||
undoSStep (th);
|
||||
- return;
|
||||
+ return 1;
|
||||
}
|
||||
|
||||
th->stepped = 1;
|
||||
th->step_pc = sh_get_next_pc (&th->context);
|
||||
insert_single_step_breakpoint (th->step_pc);
|
||||
- return;
|
||||
+
|
||||
+ return 1;
|
||||
}
|
||||
#elif defined (ARM)
|
||||
#undef check_for_step
|
||||
@@ -1026,7 +1028,7 @@ undoSStep (thread_info * th)
|
||||
}
|
||||
}
|
||||
|
||||
-void
|
||||
+int
|
||||
wince_software_single_step (enum target_signal ignore,
|
||||
int insert_breakpoints_p)
|
||||
{
|
||||
@@ -1038,14 +1040,15 @@ wince_software_single_step (enum target_
|
||||
if (!insert_breakpoints_p)
|
||||
{
|
||||
undoSStep (th);
|
||||
- return;
|
||||
+ return 1;
|
||||
}
|
||||
|
||||
th->stepped = 1;
|
||||
pc = read_register (PC_REGNUM);
|
||||
th->step_pc = arm_get_next_pc (pc);
|
||||
insert_single_step_breakpoint (th->step_pc);
|
||||
- return;
|
||||
+
|
||||
+ return 1;
|
||||
}
|
||||
#endif
|
||||
|
12
find-pc-sect-line.diff
Normal file
12
find-pc-sect-line.diff
Normal file
@ -0,0 +1,12 @@
|
||||
--- gdb/symtab.c.~1.157.~ 2007-04-16 17:39:04.000000000 +0200
|
||||
+++ gdb/symtab.c 2007-04-18 14:10:52.000000000 +0200
|
||||
@@ -2252,6 +2252,9 @@ find_pc_sect_line (CORE_ADDR pc, struct
|
||||
best_end = item->pc;
|
||||
}
|
||||
|
||||
+ if (notcurrent)
|
||||
+ pc++;
|
||||
+
|
||||
if (!best_symtab)
|
||||
{
|
||||
/* If we didn't find any line number info, just return zeros.
|
3
gdb-6.6.50.20070511-cvs.tar.bz2
Normal file
3
gdb-6.6.50.20070511-cvs.tar.bz2
Normal file
@ -0,0 +1,3 @@
|
||||
version https://git-lfs.github.com/spec/v1
|
||||
oid sha256:03271e1e1892a04e57f7d702d20b3fd981846d6dc5cead52d5babed95052c7bc
|
||||
size 14273840
|
@ -1,3 +0,0 @@
|
||||
version https://git-lfs.github.com/spec/v1
|
||||
oid sha256:6e602987298db5ddb479bbb84ce653eabd9c304957a49552245f65cdc70d43bd
|
||||
size 14535755
|
@ -1,3 +1,8 @@
|
||||
-------------------------------------------------------------------
|
||||
Fri May 11 15:22:37 CEST 2007 - schwab@suse.de
|
||||
|
||||
- Update to head of trunk.
|
||||
|
||||
-------------------------------------------------------------------
|
||||
Fri Apr 13 15:43:47 CEST 2007 - schwab@suse.de
|
||||
|
||||
|
65
gdb.spec
65
gdb.spec
@ -1,5 +1,5 @@
|
||||
#
|
||||
# spec file for package gdb (Version 6.6)
|
||||
# spec file for package gdb (Version 6.6.50.20070511)
|
||||
#
|
||||
# Copyright (c) 2007 SUSE LINUX Products GmbH, Nuernberg, Germany.
|
||||
# This file and all modifications and additions to the pristine
|
||||
@ -11,39 +11,34 @@
|
||||
# norootforbuild
|
||||
|
||||
Name: gdb
|
||||
BuildRequires: dejagnu gcc-c++ gcc-fortran gcc-java gcc-objc readline-devel
|
||||
BuildRequires: bison dejagnu flex gcc-c++ gcc-fortran gcc-java gcc-objc libexpat-devel readline-devel
|
||||
%ifarch %ix86 x86_64 ia64
|
||||
BuildRequires: libunwind-devel
|
||||
%endif
|
||||
%ifnarch ppc64 s390x
|
||||
BuildRequires: gcc-ada
|
||||
%endif
|
||||
URL: http://www.gnu.org/software/gdb/
|
||||
License: GNU General Public License (GPL)
|
||||
Group: Development/Tools/Debuggers
|
||||
Autoreqprov: on
|
||||
PreReq: %{install_info_prereq}
|
||||
Version: 6.6
|
||||
Release: 30
|
||||
Version: 6.6.50.20070511
|
||||
Release: 1
|
||||
Summary: The GNU Debugger
|
||||
Source: gdb-%{version}.tar.bz2
|
||||
Source: gdb-%{version}-cvs.tar.bz2
|
||||
Patch1: gdb-misc.patch
|
||||
Patch2: warn.patch
|
||||
Patch3: readline-5.1-random.patch
|
||||
Patch4: readnever.patch
|
||||
Patch5: gstack.patch
|
||||
Patch6: sect-index-text.diff
|
||||
Patch7: ppc-dwarf2-cfi.patch
|
||||
Patch8: pie-relocate.diff
|
||||
Patch9: mst-solib-trampoline.diff
|
||||
Patch10: readline-callback.diff
|
||||
Patch11: loader_break.diff
|
||||
Patch12: ppc-long-double.diff
|
||||
Patch13: lr-frame-offset.diff
|
||||
Patch15: solib-extract-address.diff
|
||||
Patch16: pc-regnum.diff
|
||||
Patch17: show-endian.diff
|
||||
Patch18: elf-symtab-read.diff
|
||||
Patch19: atomic-single-step.diff
|
||||
Patch20: altivec-regs.diff
|
||||
Patch21: ppc-cr-regnum.diff
|
||||
Patch7: pie-relocate.diff
|
||||
Patch8: mst-solib-trampoline.diff
|
||||
Patch9: loader_break.diff
|
||||
Patch10: ppc-long-double.diff
|
||||
Patch11: elf-symtab-read.diff
|
||||
Patch12: find-pc-sect-line.diff
|
||||
BuildRoot: %{_tmppath}/%{name}-%{version}-build
|
||||
|
||||
%description
|
||||
@ -71,33 +66,21 @@ Authors:
|
||||
Stu Grossman <grossman@cygnus.com>
|
||||
|
||||
%prep
|
||||
%setup -q
|
||||
%setup -q -n %{name}-%{version}-cvs
|
||||
%patch1
|
||||
%patch2
|
||||
%patch3
|
||||
%patch4
|
||||
%patch5
|
||||
%patch6
|
||||
cd gdb
|
||||
%patch7
|
||||
cd ..
|
||||
%patch8
|
||||
cd gdb
|
||||
%patch9
|
||||
cd ..
|
||||
%patch10
|
||||
cd gdb
|
||||
%patch11
|
||||
cd ..
|
||||
%patch12
|
||||
%patch13 -p1
|
||||
%patch15
|
||||
%patch16
|
||||
%patch17 -p1
|
||||
%patch18
|
||||
cd gdb
|
||||
%patch19
|
||||
cd ..
|
||||
%patch20
|
||||
%patch21
|
||||
|
||||
%build
|
||||
CFLAGS="$RPM_OPT_FLAGS" \
|
||||
@ -109,16 +92,18 @@ CFLAGS="$RPM_OPT_FLAGS" \
|
||||
--without-libunwind \
|
||||
%endif
|
||||
--with-separate-debug-dir=%{_prefix}/lib/debug \
|
||||
--enable-64-bit-bfd --disable-werror \
|
||||
--host=%{_target_cpu}-suse-linux
|
||||
--enable-64-bit-bfd --disable-werror --disable-tui \
|
||||
--build=%{_target_cpu}-suse-linux
|
||||
make %{?jobs:-j%jobs}
|
||||
make info
|
||||
ulimit -c unlimited
|
||||
export TERM=dumb
|
||||
make -k check || :
|
||||
|
||||
%install
|
||||
make install-gdb install-info-gdb DESTDIR="$RPM_BUILD_ROOT"
|
||||
echo '#!/bin/sh
|
||||
exec gdb --tui "$@"' > $RPM_BUILD_ROOT%{_bindir}/gdbtui
|
||||
rm -f $RPM_BUILD_ROOT%{_bindir}/run
|
||||
rm -f $RPM_BUILD_ROOT%{_mandir}/man1/run.1
|
||||
|
||||
%clean
|
||||
rm -rf $RPM_BUILD_ROOT
|
||||
@ -139,10 +124,8 @@ rm -rf $RPM_BUILD_ROOT
|
||||
%defattr(-,root,root)
|
||||
%doc COPYING COPYING.LIB gdb/README gdb/NEWS
|
||||
%{_bindir}/gdb
|
||||
%{_bindir}/gdbtui
|
||||
%{_bindir}/gstack
|
||||
%{_mandir}/man1/gdb.1.gz
|
||||
%{_mandir}/man1/gdbtui.1.gz
|
||||
%{_infodir}/annotate.info*.gz
|
||||
%{_infodir}/gdb.info*.gz
|
||||
%{_infodir}/gdbint.info*.gz
|
||||
@ -153,6 +136,8 @@ rm -rf $RPM_BUILD_ROOT
|
||||
%endif
|
||||
|
||||
%changelog
|
||||
* Fri May 11 2007 - schwab@suse.de
|
||||
- Update to head of trunk.
|
||||
* Fri Apr 13 2007 - schwab@suse.de
|
||||
- Avoid crash on object with no text section [#176306].
|
||||
* Wed Apr 11 2007 - schwab@suse.de
|
||||
|
@ -1,49 +0,0 @@
|
||||
From nobody Fri Jun 2 13:36:44 2006
|
||||
From: Anton Blanchard <anton@samba.org>
|
||||
Subject: [PATCH] Fix powerpc 64bit backtrace code
|
||||
To: gdb-patches@sourceware.org
|
||||
Date: Fri, 2 Jun 2006 12:38:24 +1000
|
||||
|
||||
|
||||
Hi,
|
||||
|
||||
When backtracing a 64bit task on ppc64/Linux I notice we sometimes get
|
||||
garbage for the PC:
|
||||
|
||||
#3 0xc00000006d337cd0 in ?? ()
|
||||
#4 0x8822248200000001 in ?? ()
|
||||
#5 0x4822248200000000 in ?? ()
|
||||
|
||||
Looking closer, it appears that gdb has missed the LR field and instead
|
||||
got the CR field. On 32bit the LR is at SP + wordsize, however on 64bit
|
||||
it is SP + 2*wordsize.
|
||||
|
||||
Knowing this I looked through the backtrace code and it looks like the
|
||||
fallback is incorrect. If we fail to determine the stack layout
|
||||
accurately we should make a guess based on the ABI. It turns out
|
||||
tdep->lr_frame_offset was created for this purpose, but isnt used
|
||||
anywhere.
|
||||
|
||||
Look OK?
|
||||
|
||||
Anton
|
||||
---
|
||||
|
||||
2006-06-02 Anton Blanchard <anton@samba.org>
|
||||
|
||||
* rs6000-tdep.c (rs6000_frame_cache): Use tdep->lr_frame_offset
|
||||
instead of wordsize when looking for the LR in a stack frame.
|
||||
|
||||
|
||||
--- src/gdb/rs6000-tdep.c~ 2006-06-02 09:34:44.000000000 +1000
|
||||
+++ src/gdb/rs6000-tdep.c 2006-06-02 09:33:42.000000000 +1000
|
||||
@@ -2988,7 +2988,7 @@
|
||||
if (make_frame)
|
||||
{
|
||||
fdata.frameless = 0;
|
||||
- fdata.lr_offset = wordsize;
|
||||
+ fdata.lr_offset = tdep->lr_frame_offset;
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -1,16 +0,0 @@
|
||||
--- gdb/frame.c 11 Jan 2007 17:40:17 +0100 1.218
|
||||
+++ gdb/frame.c 11 Jan 2007 17:43:00 +0100
|
||||
@@ -1223,8 +1223,11 @@ get_prev_frame_1 (struct frame_info *thi
|
||||
happen when the prologue analyzer finds a stack adjustment, but
|
||||
no PC save. This check does assume that the "PC register" is
|
||||
roughly a traditional PC, even if the gdbarch_unwind_pc method
|
||||
- frobs it. */
|
||||
- if (this_frame->level > 0
|
||||
+ frobs it.
|
||||
+
|
||||
+ Skip this check when there is no "PC register". */
|
||||
+ if (PC_REGNUM >= 0
|
||||
+ && this_frame->level > 0
|
||||
&& get_frame_type (this_frame) == NORMAL_FRAME
|
||||
&& get_frame_type (this_frame->next) == NORMAL_FRAME)
|
||||
{
|
@ -1,6 +1,6 @@
|
||||
--- gdb/Makefile.in
|
||||
+++ gdb/Makefile.in
|
||||
@@ -2444,7 +2444,7 @@
|
||||
@@ -2430,7 +2430,7 @@
|
||||
$(objfiles_h) $(gdb_stabs_h) $(target_h) $(bcache_h) $(mdebugread_h) \
|
||||
$(gdb_assert_h) $(gdb_stat_h) $(gdb_obstack_h) $(gdb_string_h) \
|
||||
$(hashtab_h) $(breakpoint_h) $(block_h) $(dictionary_h) $(source_h) \
|
||||
@ -9,7 +9,7 @@
|
||||
observer.o: observer.c $(defs_h) $(observer_h) $(command_h) $(gdbcmd_h) \
|
||||
$(observer_inc)
|
||||
obsd-tdep.o: obsd-tdep.c $(defs_h) $(frame_h) $(symtab_h) $(obsd_tdep_h)
|
||||
@@ -2663,9 +2663,9 @@
|
||||
@@ -2618,9 +2618,9 @@
|
||||
$(bcache_h) $(regcache_h)
|
||||
solib-svr4.o: solib-svr4.c $(defs_h) $(elf_external_h) $(elf_common_h) \
|
||||
$(elf_mips_h) $(symtab_h) $(bfd_h) $(symfile_h) $(objfiles_h) \
|
||||
@ -21,18 +21,9 @@
|
||||
sol-thread.o: sol-thread.c $(defs_h) $(gdbthread_h) $(target_h) \
|
||||
$(inferior_h) $(gdb_stat_h) $(gdbcmd_h) $(gdbcore_h) $(regcache_h) \
|
||||
$(solib_h) $(symfile_h) $(gdb_string_h) $(gregset_h)
|
||||
@@ -2773,7 +2773,7 @@
|
||||
$(objfiles_h) $(source_h) $(gdbcmd_h) $(breakpoint_h) $(language_h) \
|
||||
$(complaints_h) $(demangle_h) $(inferior_h) $(filenames_h) \
|
||||
$(gdb_stabs_h) $(gdb_obstack_h) $(completer_h) $(bcache_h) \
|
||||
- $(hashtab_h) $(readline_h) $(gdb_assert_h) $(block_h) \
|
||||
+ $(hashtab_h) $(readline_h) $(gdb_assert_h) $(block_h) $(varobj_h) \
|
||||
$(gdb_string_h) $(gdb_stat_h) $(observer_h) $(exec_h) \
|
||||
$(parser_defs_h)
|
||||
symfile-mem.o: symfile-mem.c $(defs_h) $(symtab_h) $(gdbcore_h) \
|
||||
--- gdb/breakpoint.c
|
||||
+++ gdb/breakpoint.c
|
||||
@@ -3810,6 +3810,7 @@
|
||||
@@ -3912,6 +3912,7 @@
|
||||
printf_filtered ("%s%s ",
|
||||
((b->enable_state == bp_disabled ||
|
||||
b->enable_state == bp_shlib_disabled ||
|
||||
@ -40,7 +31,7 @@
|
||||
b->enable_state == bp_call_disabled)
|
||||
? " (disabled)"
|
||||
: b->enable_state == bp_permanent
|
||||
@@ -4487,6 +4488,60 @@
|
||||
@@ -4588,6 +4589,60 @@
|
||||
}
|
||||
}
|
||||
|
||||
@ -101,7 +92,7 @@
|
||||
static void
|
||||
solib_load_unload_1 (char *hookname, int tempflag, char *dll_pathname,
|
||||
char *cond_string, enum bptype bp_kind)
|
||||
@@ -6833,6 +6888,7 @@
|
||||
@@ -7025,6 +7080,7 @@
|
||||
&& !b->loc->duplicate
|
||||
&& b->enable_state != bp_disabled
|
||||
&& b->enable_state != bp_shlib_disabled
|
||||
@ -109,7 +100,7 @@
|
||||
&& !b->pending
|
||||
&& b->enable_state != bp_call_disabled)
|
||||
{
|
||||
@@ -7048,7 +7104,8 @@
|
||||
@@ -7243,7 +7299,8 @@
|
||||
break;
|
||||
|
||||
save_enable = b->enable_state;
|
||||
@ -121,7 +112,7 @@
|
||||
/* If resetting a shlib-disabled breakpoint, we don't want to
|
||||
--- gdb/breakpoint.h
|
||||
+++ gdb/breakpoint.h
|
||||
@@ -159,6 +159,7 @@
|
||||
@@ -155,6 +155,7 @@
|
||||
automatically enabled and reset when the call
|
||||
"lands" (either completes, or stops at another
|
||||
eventpoint). */
|
||||
@ -129,7 +120,7 @@
|
||||
bp_permanent /* There is a breakpoint instruction hard-wired into
|
||||
the target's code. Don't try to write another
|
||||
breakpoint instruction on top of it, or restore
|
||||
@@ -794,8 +795,12 @@
|
||||
@@ -797,8 +798,12 @@
|
||||
|
||||
extern void disable_breakpoints_in_shlibs (int silent);
|
||||
|
||||
@ -144,7 +135,7 @@
|
||||
extern void create_solib_unload_event_breakpoint (char *, int,
|
||||
--- gdb/dwarf2read.c
|
||||
+++ gdb/dwarf2read.c
|
||||
@@ -1221,7 +1221,7 @@
|
||||
@@ -1230,7 +1230,7 @@
|
||||
else
|
||||
dwarf2_per_objfile->loc_buffer = NULL;
|
||||
|
||||
@ -155,7 +146,7 @@
|
||||
{
|
||||
--- gdb/elfread.c
|
||||
+++ gdb/elfread.c
|
||||
@@ -556,7 +556,7 @@
|
||||
@@ -541,7 +541,7 @@
|
||||
/* If we are reinitializing, or if we have never loaded syms yet,
|
||||
set table to empty. MAINLINE is cleared so that *_read_psymtab
|
||||
functions do not all also re-initialize the psymbol table. */
|
||||
@ -166,7 +157,7 @@
|
||||
mainline = 0;
|
||||
--- gdb/infrun.c
|
||||
+++ gdb/infrun.c
|
||||
@@ -2203,6 +2203,11 @@
|
||||
@@ -2239,6 +2239,11 @@
|
||||
code segments in shared libraries might be mapped in now. */
|
||||
re_enable_breakpoints_in_shlibs ();
|
||||
|
||||
@ -209,7 +200,7 @@
|
||||
/* Create the terminating entry of OBJFILE's minimal symbol table.
|
||||
--- gdb/solib-svr4.c
|
||||
+++ gdb/solib-svr4.c
|
||||
@@ -34,6 +34,7 @@
|
||||
@@ -33,6 +33,7 @@
|
||||
#include "gdbcore.h"
|
||||
#include "target.h"
|
||||
#include "inferior.h"
|
||||
@ -217,7 +208,7 @@
|
||||
|
||||
#include "gdb_assert.h"
|
||||
|
||||
@@ -44,6 +45,7 @@
|
||||
@@ -43,6 +44,7 @@
|
||||
#include "bfd-target.h"
|
||||
#include "elf-bfd.h"
|
||||
#include "exec.h"
|
||||
@ -225,7 +216,7 @@
|
||||
|
||||
static struct link_map_offsets *svr4_fetch_link_map_offsets (void);
|
||||
static int svr4_have_link_map_offsets (void);
|
||||
@@ -278,8 +280,6 @@
|
||||
@@ -261,8 +263,6 @@
|
||||
|
||||
/* Local function prototypes */
|
||||
|
||||
@ -234,7 +225,7 @@
|
||||
static CORE_ADDR bfd_lookup_symbol (bfd *, char *, flagword);
|
||||
|
||||
/*
|
||||
@@ -404,17 +404,29 @@
|
||||
@@ -387,6 +387,16 @@
|
||||
gdb_byte *buf;
|
||||
gdb_byte *bufend;
|
||||
int arch_size;
|
||||
@ -251,8 +242,9 @@
|
||||
|
||||
/* Find the start address of the .dynamic section. */
|
||||
dyninfo_sect = bfd_get_section_by_name (exec_bfd, ".dynamic");
|
||||
if (dyninfo_sect == NULL)
|
||||
return 0;
|
||||
@@ -404,11 +414,13 @@
|
||||
}
|
||||
|
||||
dyninfo_addr = bfd_section_vma (exec_bfd, dyninfo_sect);
|
||||
+ relocated_dyninfo_addr
|
||||
+ = dyninfo_addr + entry_addr - bfd_get_start_address (exec_bfd);
|
||||
@ -265,7 +257,7 @@
|
||||
return 0;
|
||||
|
||||
/* Find the DT_DEBUG entry in the the .dynamic section.
|
||||
@@ -763,9 +775,55 @@
|
||||
@@ -757,9 +769,55 @@
|
||||
does have a name, so we can no longer use a missing name to
|
||||
decide when to ignore it. */
|
||||
if (IGNORE_FIRST_LINK_MAP_ENTRY (new) && ldsomap == 0)
|
||||
@ -322,7 +314,7 @@
|
||||
int errcode;
|
||||
char *buffer;
|
||||
|
||||
@@ -783,10 +841,8 @@
|
||||
@@ -777,10 +835,8 @@
|
||||
strcpy (new->so_original_name, new->so_name);
|
||||
}
|
||||
|
||||
@ -335,7 +327,7 @@
|
||||
free_so (new);
|
||||
else
|
||||
{
|
||||
@@ -882,24 +938,6 @@
|
||||
@@ -876,24 +932,6 @@
|
||||
return 0;
|
||||
}
|
||||
|
||||
@ -360,7 +352,7 @@
|
||||
/* Return 1 if PC lies in the dynamic symbol resolution code of the
|
||||
SVR4 run time loader. */
|
||||
static CORE_ADDR interp_text_sect_low;
|
||||
@@ -1384,6 +1422,8 @@
|
||||
@@ -1378,6 +1416,8 @@
|
||||
while (stop_signal != TARGET_SIGNAL_TRAP);
|
||||
stop_soon = NO_STOP_QUIETLY;
|
||||
#endif /* defined(_SCO_DS) */
|
||||
@ -371,7 +363,7 @@
|
||||
static void
|
||||
--- gdb/solib.c
|
||||
+++ gdb/solib.c
|
||||
@@ -396,15 +396,37 @@
|
||||
@@ -384,15 +384,37 @@
|
||||
/* Have we already loaded this shared object? */
|
||||
ALL_OBJFILES (so->objfile)
|
||||
{
|
||||
@ -412,7 +404,7 @@
|
||||
free_section_addr_info (sap);
|
||||
|
||||
return (1);
|
||||
@@ -585,28 +607,7 @@
|
||||
@@ -573,28 +595,7 @@
|
||||
/* Fill in the rest of each of the `struct so_list' nodes. */
|
||||
for (i = inferior; i; i = i->next)
|
||||
{
|
||||
@ -442,7 +434,7 @@
|
||||
|
||||
/* Notify any observer that the shared object has been
|
||||
loaded now that we've added it to GDB's tables. */
|
||||
@@ -702,6 +703,39 @@
|
||||
@@ -690,6 +691,39 @@
|
||||
}
|
||||
}
|
||||
|
||||
@ -484,7 +476,7 @@
|
||||
|
||||
--- gdb/solist.h
|
||||
+++ gdb/solist.h
|
||||
@@ -62,6 +62,8 @@
|
||||
@@ -61,6 +61,8 @@
|
||||
bfd *abfd;
|
||||
char symbols_loaded; /* flag: symbols read in yet? */
|
||||
char from_tty; /* flag: print msgs? */
|
||||
@ -493,7 +485,7 @@
|
||||
struct objfile *objfile; /* objfile for loaded lib */
|
||||
struct section_table *sections;
|
||||
struct section_table *sections_end;
|
||||
@@ -116,6 +118,10 @@
|
||||
@@ -115,6 +117,10 @@
|
||||
/* Find solib binary file and open it. */
|
||||
extern int solib_open (char *in_pathname, char **found_pathname);
|
||||
|
||||
@ -517,15 +509,7 @@
|
||||
reinit_frame_cache ();
|
||||
--- gdb/symfile.c
|
||||
+++ gdb/symfile.c
|
||||
@@ -49,6 +49,7 @@
|
||||
#include "readline/readline.h"
|
||||
#include "gdb_assert.h"
|
||||
#include "block.h"
|
||||
+#include "varobj.h"
|
||||
#include "observer.h"
|
||||
#include "exec.h"
|
||||
#include "parser-defs.h"
|
||||
@@ -660,7 +661,7 @@
|
||||
@@ -709,7 +709,7 @@
|
||||
|
||||
/* Now either addrs or offsets is non-zero. */
|
||||
|
||||
@ -534,7 +518,7 @@
|
||||
{
|
||||
/* We will modify the main symbol table, make sure that all its users
|
||||
will be cleaned up if an error occurs during symbol reading. */
|
||||
@@ -688,7 +689,7 @@
|
||||
@@ -737,7 +737,7 @@
|
||||
|
||||
We no longer warn if the lowest section is not a text segment (as
|
||||
happens for the PA64 port. */
|
||||
@ -543,7 +527,7 @@
|
||||
{
|
||||
asection *lower_sect;
|
||||
asection *sect;
|
||||
@@ -857,14 +858,14 @@
|
||||
@@ -906,14 +906,14 @@
|
||||
/* If this is the main symbol file we have to clean up all users of the
|
||||
old main symbol file. Otherwise it is sufficient to fixup all the
|
||||
breakpoints that may have been redefined by this symbol file. */
|
||||
@ -560,7 +544,7 @@
|
||||
{
|
||||
breakpoint_re_set ();
|
||||
}
|
||||
@@ -910,7 +911,7 @@
|
||||
@@ -959,7 +959,7 @@
|
||||
interactively wiping out any existing symbols. */
|
||||
|
||||
if ((have_full_symbols () || have_partial_symbols ())
|
||||
@ -569,7 +553,7 @@
|
||||
&& from_tty
|
||||
&& !query ("Load new symbol table from \"%s\"? ", name))
|
||||
error (_("Not confirmed."));
|
||||
@@ -1091,6 +1092,11 @@
|
||||
@@ -1140,6 +1140,11 @@
|
||||
symfile_objfile->name)
|
||||
: !query (_("Discard symbol table? "))))
|
||||
error (_("Not confirmed."));
|
||||
@ -581,7 +565,7 @@
|
||||
free_all_objfiles ();
|
||||
|
||||
/* solib descriptors may have handles to objfiles. Since their
|
||||
@@ -2205,6 +2211,8 @@
|
||||
@@ -2279,6 +2284,8 @@
|
||||
/* Discard cleanups as symbol reading was successful. */
|
||||
discard_cleanups (old_cleanups);
|
||||
|
||||
@ -590,7 +574,7 @@
|
||||
/* If the mtime has changed between the time we set new_modtime
|
||||
and now, we *want* this to be out of date, so don't call stat
|
||||
again now. */
|
||||
@@ -2580,6 +2588,7 @@
|
||||
@@ -2646,6 +2653,7 @@
|
||||
clear_pc_function_cache ();
|
||||
if (deprecated_target_new_objfile_hook)
|
||||
deprecated_target_new_objfile_hook (NULL);
|
||||
@ -600,8 +584,8 @@
|
||||
FIXME: It's not clear which of these are supposed to persist
|
||||
--- gdb/varobj.c
|
||||
+++ gdb/varobj.c
|
||||
@@ -870,6 +870,58 @@
|
||||
return rootcount;
|
||||
@@ -1077,6 +1077,58 @@
|
||||
return changed;
|
||||
}
|
||||
|
||||
+void
|
||||
@ -661,9 +645,9 @@
|
||||
expression to see if it's changed. Then go all the way
|
||||
--- gdb/varobj.h
|
||||
+++ gdb/varobj.h
|
||||
@@ -99,4 +99,6 @@
|
||||
@@ -114,4 +114,6 @@
|
||||
|
||||
extern int varobj_update (struct varobj **varp, struct varobj ***changelist);
|
||||
extern void varobj_invalidate (void);
|
||||
|
||||
+extern void varobj_refresh (void);
|
||||
+
|
||||
|
@ -1,16 +0,0 @@
|
||||
2007-04-01 Andreas Schwab <schwab@suse.de>
|
||||
|
||||
* rs6000-tdep.c (rs6000_dwarf2_reg_to_regnum): Decode 64 as CR
|
||||
register.
|
||||
|
||||
--- gdb/rs6000-tdep.c 01 Apr 2007 21:23:44 +0200 1.269
|
||||
+++ gdb/rs6000-tdep.c 01 Apr 2007 21:24:17 +0200
|
||||
@@ -2274,6 +2274,8 @@ rs6000_dwarf2_reg_to_regnum (int num)
|
||||
else
|
||||
switch (num)
|
||||
{
|
||||
+ case 64:
|
||||
+ return tdep->ppc_cr_regnum;
|
||||
case 67:
|
||||
return tdep->ppc_vrsave_regnum - 1; /* vscr */
|
||||
case 99:
|
@ -1,411 +0,0 @@
|
||||
From nobody Mon Mar 12 17:19:12 2007
|
||||
From: Daniel Jacobowitz <drow@false.org>
|
||||
Subject: Enable CFI for PowerPC, try 3
|
||||
To: gdb-patches@sourceware.org
|
||||
Date: Mon, 12 Mar 2007 12:12:19 -0400
|
||||
Mail-Followup-To: gdb-patches@sourceware.org
|
||||
|
||||
The last two times that we (Jim B, and then Andreas) tried to enable
|
||||
PowerPC CFI, we ran into problems with GCC. It used to emit bogus
|
||||
unwind tables. This has since been fixed - see the comment in the
|
||||
patch below for the gory details - but if you get it wrong it's such a
|
||||
messy and terrible outcome. So here's some workarounds.
|
||||
|
||||
+ /* GCC releases before 3.4 use GCC internal register numbering in
|
||||
+ .debug_frame (and .debug_info, et cetera). The numbering is
|
||||
+ different from the standard SysV numbering for everything except
|
||||
+ for GPRs and FPRs. We can not detect this problem in most cases
|
||||
+ - to get accurate debug info for variables living in lr, ctr, v0,
|
||||
+ et cetera, use a newer version of GCC. But we must detect
|
||||
+ one important case - lr is in column 65 in .debug_frame output,
|
||||
+ instead of 108.
|
||||
+
|
||||
+ GCC 3.4, and the "hammer" branch, have a related problem. They
|
||||
+ record lr register saves in .debug_frame as 108, but still record
|
||||
+ the return column as 65. We fix that up too.
|
||||
+
|
||||
+ We can do this because 65 is assigned to fpsr, and GCC never
|
||||
+ generates debug info referring to it. To add support for
|
||||
+ handwritten debug info that restores fpsr, we would need to add a
|
||||
+ producer version check to this. */
|
||||
|
||||
I tested this, before and after, with GCC 3.3.6, 3.4.4, and 4.1.1. It
|
||||
fixed 23, 24, and 25 failures respectively - most notably we can now
|
||||
backtrace out of glibc in tls.exp. The others may be weaknesses in
|
||||
the prologue analyzer - I didn't look deeply.
|
||||
|
||||
I also verified that with CFI, but without the rest of the workaround,
|
||||
GCC 3.4.4 is unhappy.
|
||||
|
||||
Any comments? And would anyone else like to try this patch before I
|
||||
check it in?
|
||||
|
||||
--
|
||||
Daniel Jacobowitz
|
||||
CodeSourcery
|
||||
|
||||
2007-03-12 Andreas Schwab <schwab@suse.de>
|
||||
Daniel Jacobowitz <dan@codesourcery.com>
|
||||
|
||||
* dwarf2-frame.c (dwarf2_frame_eh_frame_regnum): Rename to...
|
||||
(dwarf2_frame_adjust_regnum): ...this. Make static. Add eh_frame_p
|
||||
argument. Update all callers.
|
||||
(struct dwarf2_frame_ops): Replace eh_frame_regnum with adjust_regnum.
|
||||
(dwarf2_frame_set_eh_frame_regnum): Rename to...
|
||||
(dwarf2_frame_set_adjust_regnum): ...this. Update argument type.
|
||||
* dwarf2frame.h (dwarf2_frame_set_eh_frame_regnum): Rename to...
|
||||
(dwarf2_frame_set_adjust_regnum): ...this.
|
||||
(dwarf2_frame_eh_frame_regnum): Delete prototype.
|
||||
* rs6000-tdep.c: Include "dwarf2-frame.h".
|
||||
(rs6000_adjust_frame_regnum): Define.
|
||||
(rs6000_gdbarch_init): Enable use of DWARF CFI frame unwinder.
|
||||
Register rs6000_adjust_frame_regnum.
|
||||
|
||||
* Makefile.in (rs6000-tdep.o): Update dependencies.
|
||||
|
||||
Index: Makefile.in
|
||||
===================================================================
|
||||
RCS file: /home/gcc/repos/src/src/gdb/Makefile.in,v
|
||||
retrieving revision 1.883
|
||||
diff -u -p -r1.883 Makefile.in
|
||||
--- Makefile.in 2 Mar 2007 21:28:18 -0000 1.883
|
||||
+++ Makefile.in 12 Mar 2007 12:23:24 -0000
|
||||
@@ -2584,7 +2584,7 @@ rs6000-tdep.o: rs6000-tdep.c $(defs_h) $
|
||||
$(reggroups_h) $(libbfd_h) $(coff_internal_h) $(libcoff_h) \
|
||||
$(coff_xcoff_h) $(libxcoff_h) $(elf_bfd_h) $(solib_svr4_h) \
|
||||
$(ppc_tdep_h) $(gdb_assert_h) $(dis_asm_h) $(trad_frame_h) \
|
||||
- $(frame_unwind_h) $(frame_base_h) $(rs6000_tdep_h)
|
||||
+ $(frame_unwind_h) $(frame_base_h) $(rs6000_tdep_h) $(dwarf2_frame_h)
|
||||
rs6000-aix-tdep.o: rs6000-aix-tdep.c $(defs_h) $(osabi_h) $(rs6000_tdep_h)
|
||||
s390-nat.o: s390-nat.c $(defs_h) $(regcache_h) $(inferior_h) \
|
||||
$(s390_tdep_h) $(target_h) $(linux_nat_h)
|
||||
Index: dwarf2-frame.c
|
||||
===================================================================
|
||||
RCS file: /home/gcc/repos/src/src/gdb/dwarf2-frame.c,v
|
||||
retrieving revision 1.68
|
||||
diff -u -p -r1.68 dwarf2-frame.c
|
||||
--- dwarf2-frame.c 27 Feb 2007 20:17:18 -0000 1.68
|
||||
+++ dwarf2-frame.c 12 Mar 2007 13:36:31 -0000
|
||||
@@ -107,6 +107,9 @@ struct dwarf2_fde
|
||||
};
|
||||
|
||||
static struct dwarf2_fde *dwarf2_frame_find_fde (CORE_ADDR *pc);
|
||||
+
|
||||
+static int dwarf2_frame_adjust_regnum (struct gdbarch *gdbarch, int regnum,
|
||||
+ int eh_frame_p);
|
||||
|
||||
|
||||
/* Structure describing a frame state. */
|
||||
@@ -314,8 +317,7 @@ execute_cfa_program (gdb_byte *insn_ptr,
|
||||
else if ((insn & 0xc0) == DW_CFA_offset)
|
||||
{
|
||||
reg = insn & 0x3f;
|
||||
- if (eh_frame_p)
|
||||
- reg = dwarf2_frame_eh_frame_regnum (gdbarch, reg);
|
||||
+ reg = dwarf2_frame_adjust_regnum (gdbarch, reg, eh_frame_p);
|
||||
insn_ptr = read_uleb128 (insn_ptr, insn_end, &utmp);
|
||||
offset = utmp * fs->data_align;
|
||||
dwarf2_frame_state_alloc_regs (&fs->regs, reg + 1);
|
||||
@@ -326,8 +328,7 @@ execute_cfa_program (gdb_byte *insn_ptr,
|
||||
{
|
||||
gdb_assert (fs->initial.reg);
|
||||
reg = insn & 0x3f;
|
||||
- if (eh_frame_p)
|
||||
- reg = dwarf2_frame_eh_frame_regnum (gdbarch, reg);
|
||||
+ reg = dwarf2_frame_adjust_regnum (gdbarch, reg, eh_frame_p);
|
||||
dwarf2_frame_state_alloc_regs (&fs->regs, reg + 1);
|
||||
if (reg < fs->initial.num_regs)
|
||||
fs->regs.reg[reg] = fs->initial.reg[reg];
|
||||
@@ -368,8 +369,7 @@ register %s (#%d) at 0x%s"),
|
||||
|
||||
case DW_CFA_offset_extended:
|
||||
insn_ptr = read_uleb128 (insn_ptr, insn_end, ®);
|
||||
- if (eh_frame_p)
|
||||
- reg = dwarf2_frame_eh_frame_regnum (gdbarch, reg);
|
||||
+ reg = dwarf2_frame_adjust_regnum (gdbarch, reg, eh_frame_p);
|
||||
insn_ptr = read_uleb128 (insn_ptr, insn_end, &utmp);
|
||||
offset = utmp * fs->data_align;
|
||||
dwarf2_frame_state_alloc_regs (&fs->regs, reg + 1);
|
||||
@@ -380,35 +380,30 @@ register %s (#%d) at 0x%s"),
|
||||
case DW_CFA_restore_extended:
|
||||
gdb_assert (fs->initial.reg);
|
||||
insn_ptr = read_uleb128 (insn_ptr, insn_end, ®);
|
||||
- if (eh_frame_p)
|
||||
- reg = dwarf2_frame_eh_frame_regnum (gdbarch, reg);
|
||||
+ reg = dwarf2_frame_adjust_regnum (gdbarch, reg, eh_frame_p);
|
||||
dwarf2_frame_state_alloc_regs (&fs->regs, reg + 1);
|
||||
fs->regs.reg[reg] = fs->initial.reg[reg];
|
||||
break;
|
||||
|
||||
case DW_CFA_undefined:
|
||||
insn_ptr = read_uleb128 (insn_ptr, insn_end, ®);
|
||||
- if (eh_frame_p)
|
||||
- reg = dwarf2_frame_eh_frame_regnum (gdbarch, reg);
|
||||
+ reg = dwarf2_frame_adjust_regnum (gdbarch, reg, eh_frame_p);
|
||||
dwarf2_frame_state_alloc_regs (&fs->regs, reg + 1);
|
||||
fs->regs.reg[reg].how = DWARF2_FRAME_REG_UNDEFINED;
|
||||
break;
|
||||
|
||||
case DW_CFA_same_value:
|
||||
insn_ptr = read_uleb128 (insn_ptr, insn_end, ®);
|
||||
- if (eh_frame_p)
|
||||
- reg = dwarf2_frame_eh_frame_regnum (gdbarch, reg);
|
||||
+ reg = dwarf2_frame_adjust_regnum (gdbarch, reg, eh_frame_p);
|
||||
dwarf2_frame_state_alloc_regs (&fs->regs, reg + 1);
|
||||
fs->regs.reg[reg].how = DWARF2_FRAME_REG_SAME_VALUE;
|
||||
break;
|
||||
|
||||
case DW_CFA_register:
|
||||
insn_ptr = read_uleb128 (insn_ptr, insn_end, ®);
|
||||
- if (eh_frame_p)
|
||||
- reg = dwarf2_frame_eh_frame_regnum (gdbarch, reg);
|
||||
+ reg = dwarf2_frame_adjust_regnum (gdbarch, reg, eh_frame_p);
|
||||
insn_ptr = read_uleb128 (insn_ptr, insn_end, &utmp);
|
||||
- if (eh_frame_p)
|
||||
- utmp = dwarf2_frame_eh_frame_regnum (gdbarch, utmp);
|
||||
+ utmp = dwarf2_frame_adjust_regnum (gdbarch, utmp, eh_frame_p);
|
||||
dwarf2_frame_state_alloc_regs (&fs->regs, reg + 1);
|
||||
fs->regs.reg[reg].how = DWARF2_FRAME_REG_SAVED_REG;
|
||||
fs->regs.reg[reg].loc.reg = utmp;
|
||||
@@ -456,9 +451,8 @@ bad CFI data; mismatched DW_CFA_restore_
|
||||
|
||||
case DW_CFA_def_cfa_register:
|
||||
insn_ptr = read_uleb128 (insn_ptr, insn_end, &fs->cfa_reg);
|
||||
- if (eh_frame_p)
|
||||
- fs->cfa_reg = dwarf2_frame_eh_frame_regnum (gdbarch,
|
||||
- fs->cfa_reg);
|
||||
+ fs->cfa_reg = dwarf2_frame_adjust_regnum (gdbarch, fs->cfa_reg,
|
||||
+ eh_frame_p);
|
||||
fs->cfa_how = CFA_REG_OFFSET;
|
||||
break;
|
||||
|
||||
@@ -484,8 +478,7 @@ bad CFI data; mismatched DW_CFA_restore_
|
||||
|
||||
case DW_CFA_expression:
|
||||
insn_ptr = read_uleb128 (insn_ptr, insn_end, ®);
|
||||
- if (eh_frame_p)
|
||||
- reg = dwarf2_frame_eh_frame_regnum (gdbarch, reg);
|
||||
+ reg = dwarf2_frame_adjust_regnum (gdbarch, reg, eh_frame_p);
|
||||
dwarf2_frame_state_alloc_regs (&fs->regs, reg + 1);
|
||||
insn_ptr = read_uleb128 (insn_ptr, insn_end, &utmp);
|
||||
fs->regs.reg[reg].loc.exp = insn_ptr;
|
||||
@@ -496,8 +489,7 @@ bad CFI data; mismatched DW_CFA_restore_
|
||||
|
||||
case DW_CFA_offset_extended_sf:
|
||||
insn_ptr = read_uleb128 (insn_ptr, insn_end, ®);
|
||||
- if (eh_frame_p)
|
||||
- reg = dwarf2_frame_eh_frame_regnum (gdbarch, reg);
|
||||
+ reg = dwarf2_frame_adjust_regnum (gdbarch, reg, eh_frame_p);
|
||||
insn_ptr = read_sleb128 (insn_ptr, insn_end, &offset);
|
||||
offset *= fs->data_align;
|
||||
dwarf2_frame_state_alloc_regs (&fs->regs, reg + 1);
|
||||
@@ -535,9 +527,8 @@ bad CFI data; mismatched DW_CFA_restore_
|
||||
|
||||
case DW_CFA_def_cfa_sf:
|
||||
insn_ptr = read_uleb128 (insn_ptr, insn_end, &fs->cfa_reg);
|
||||
- if (eh_frame_p)
|
||||
- fs->cfa_reg = dwarf2_frame_eh_frame_regnum (gdbarch,
|
||||
- fs->cfa_reg);
|
||||
+ fs->cfa_reg = dwarf2_frame_adjust_regnum (gdbarch, fs->cfa_reg,
|
||||
+ eh_frame_p);
|
||||
insn_ptr = read_sleb128 (insn_ptr, insn_end, &offset);
|
||||
fs->cfa_offset = offset * fs->data_align;
|
||||
fs->cfa_how = CFA_REG_OFFSET;
|
||||
@@ -617,8 +607,9 @@ struct dwarf2_frame_ops
|
||||
trampoline. */
|
||||
int (*signal_frame_p) (struct gdbarch *, struct frame_info *);
|
||||
|
||||
- /* Convert .eh_frame register number to DWARF register number. */
|
||||
- int (*eh_frame_regnum) (struct gdbarch *, int);
|
||||
+ /* Convert .eh_frame register number to DWARF register number, or
|
||||
+ adjust .debug_frame register number. */
|
||||
+ int (*adjust_regnum) (struct gdbarch *, int, int);
|
||||
};
|
||||
|
||||
/* Default architecture-specific register state initialization
|
||||
@@ -726,29 +717,30 @@ dwarf2_frame_signal_frame_p (struct gdba
|
||||
return ops->signal_frame_p (gdbarch, next_frame);
|
||||
}
|
||||
|
||||
-/* Set the architecture-specific mapping of .eh_frame register numbers to
|
||||
- DWARF register numbers. */
|
||||
+/* Set the architecture-specific adjustment of .eh_frame and .debug_frame
|
||||
+ register numbers. */
|
||||
|
||||
void
|
||||
-dwarf2_frame_set_eh_frame_regnum (struct gdbarch *gdbarch,
|
||||
- int (*eh_frame_regnum) (struct gdbarch *,
|
||||
- int))
|
||||
+dwarf2_frame_set_adjust_regnum (struct gdbarch *gdbarch,
|
||||
+ int (*adjust_regnum) (struct gdbarch *,
|
||||
+ int, int))
|
||||
{
|
||||
struct dwarf2_frame_ops *ops = gdbarch_data (gdbarch, dwarf2_frame_data);
|
||||
|
||||
- ops->eh_frame_regnum = eh_frame_regnum;
|
||||
+ ops->adjust_regnum = adjust_regnum;
|
||||
}
|
||||
|
||||
-/* Translate a .eh_frame register to DWARF register. */
|
||||
+/* Translate a .eh_frame register to DWARF register, or adjust a .debug_frame
|
||||
+ register. */
|
||||
|
||||
-int
|
||||
-dwarf2_frame_eh_frame_regnum (struct gdbarch *gdbarch, int regnum)
|
||||
+static int
|
||||
+dwarf2_frame_adjust_regnum (struct gdbarch *gdbarch, int regnum, int eh_frame_p)
|
||||
{
|
||||
struct dwarf2_frame_ops *ops = gdbarch_data (gdbarch, dwarf2_frame_data);
|
||||
|
||||
- if (ops->eh_frame_regnum == NULL)
|
||||
+ if (ops->adjust_regnum == NULL)
|
||||
return regnum;
|
||||
- return ops->eh_frame_regnum (gdbarch, regnum);
|
||||
+ return ops->adjust_regnum (gdbarch, regnum, eh_frame_p);
|
||||
}
|
||||
|
||||
static void
|
||||
@@ -1726,10 +1718,10 @@ decode_frame_entry_1 (struct comp_unit *
|
||||
else
|
||||
cie->return_address_register = read_unsigned_leb128 (unit->abfd, buf,
|
||||
&bytes_read);
|
||||
- if (eh_frame_p)
|
||||
- cie->return_address_register
|
||||
- = dwarf2_frame_eh_frame_regnum (current_gdbarch,
|
||||
- cie->return_address_register);
|
||||
+ cie->return_address_register
|
||||
+ = dwarf2_frame_adjust_regnum (current_gdbarch,
|
||||
+ cie->return_address_register,
|
||||
+ eh_frame_p);
|
||||
|
||||
buf += bytes_read;
|
||||
|
||||
Index: dwarf2-frame.h
|
||||
===================================================================
|
||||
RCS file: /home/gcc/repos/src/src/gdb/dwarf2-frame.h,v
|
||||
retrieving revision 1.14
|
||||
diff -u -p -r1.14 dwarf2-frame.h
|
||||
--- dwarf2-frame.h 9 Jan 2007 17:58:50 -0000 1.14
|
||||
+++ dwarf2-frame.h 12 Mar 2007 13:26:48 -0000
|
||||
@@ -94,18 +94,13 @@ extern void
|
||||
int (*signal_frame_p) (struct gdbarch *,
|
||||
struct frame_info *));
|
||||
|
||||
-/* Set the architecture-specific mapping of .eh_frame register numbers to
|
||||
- DWARF register numbers. */
|
||||
+/* Set the architecture-specific adjustment of .eh_frame and .debug_frame
|
||||
+ register numbers. */
|
||||
|
||||
extern void
|
||||
- dwarf2_frame_set_eh_frame_regnum (struct gdbarch *gdbarch,
|
||||
- int (*eh_frame_regnum) (struct gdbarch *,
|
||||
- int));
|
||||
-
|
||||
-/* Translate a .eh_frame register to DWARF register. */
|
||||
-
|
||||
-extern int
|
||||
- dwarf2_frame_eh_frame_regnum (struct gdbarch *gdbarch, int regnum);
|
||||
+ dwarf2_frame_set_adjust_regnum (struct gdbarch *gdbarch,
|
||||
+ int (*adjust_regnum) (struct gdbarch *,
|
||||
+ int, int));
|
||||
|
||||
/* Return the frame unwind methods for the function that contains PC,
|
||||
or NULL if it can't be handled by DWARF CFI frame unwinder. */
|
||||
Index: rs6000-tdep.c
|
||||
===================================================================
|
||||
RCS file: /home/gcc/repos/src/src/gdb/rs6000-tdep.c,v
|
||||
retrieving revision 1.265
|
||||
diff -u -p -r1.265 rs6000-tdep.c
|
||||
--- rs6000-tdep.c 27 Feb 2007 23:04:28 -0000 1.265
|
||||
+++ rs6000-tdep.c 12 Mar 2007 13:36:01 -0000
|
||||
@@ -40,6 +40,7 @@
|
||||
#include "sim-regno.h"
|
||||
#include "gdb/sim-ppc.h"
|
||||
#include "reggroups.h"
|
||||
+#include "dwarf2-frame.h"
|
||||
|
||||
#include "libbfd.h" /* for bfd_default_set_arch_mach */
|
||||
#include "coff/internal.h" /* for libcoff.h */
|
||||
@@ -2211,6 +2212,70 @@ e500_pseudo_register_read (struct gdbarc
|
||||
}
|
||||
}
|
||||
|
||||
+/* Translate a .eh_frame register to DWARF register, or adjust a
|
||||
+ .debug_frame register. */
|
||||
+
|
||||
+static int
|
||||
+rs6000_adjust_frame_regnum (struct gdbarch *gdbarch, int num, int eh_frame_p)
|
||||
+{
|
||||
+ /* GCC releases before 3.4 use GCC internal register numbering in
|
||||
+ .debug_frame (and .debug_info, et cetera). The numbering is
|
||||
+ different from the standard SysV numbering for everything except
|
||||
+ for GPRs and FPRs. We can not detect this problem in most cases
|
||||
+ - to get accurate debug info for variables living in lr, ctr, v0,
|
||||
+ et cetera, use a newer version of GCC. But we must detect
|
||||
+ one important case - lr is in column 65 in .debug_frame output,
|
||||
+ instead of 108.
|
||||
+
|
||||
+ GCC 3.4, and the "hammer" branch, have a related problem. They
|
||||
+ record lr register saves in .debug_frame as 108, but still record
|
||||
+ the return column as 65. We fix that up too.
|
||||
+
|
||||
+ We can do this because 65 is assigned to fpsr, and GCC never
|
||||
+ generates debug info referring to it. To add support for
|
||||
+ handwritten debug info that restores fpsr, we would need to add a
|
||||
+ producer version check to this. */
|
||||
+ if (!eh_frame_p)
|
||||
+ {
|
||||
+ if (num == 65)
|
||||
+ return 108;
|
||||
+ else
|
||||
+ return num;
|
||||
+ }
|
||||
+
|
||||
+ /* .eh_frame is GCC specific. For binary compatibility, it uses GCC
|
||||
+ internal register numbering; translate that to the standard DWARF2
|
||||
+ register numbering. */
|
||||
+ if (0 <= num && num <= 63) /* r0-r31,fp0-fp31 */
|
||||
+ return num;
|
||||
+ else if (68 <= num && num <= 75) /* cr0-cr8 */
|
||||
+ return num - 68 + 86;
|
||||
+ else if (77 <= num && num <= 108) /* vr0-vr31 */
|
||||
+ return num - 77 + 1124;
|
||||
+ else
|
||||
+ switch (num)
|
||||
+ {
|
||||
+ case 64: /* mq */
|
||||
+ return 100;
|
||||
+ case 65: /* lr */
|
||||
+ return 108;
|
||||
+ case 66: /* ctr */
|
||||
+ return 109;
|
||||
+ case 76: /* xer */
|
||||
+ return 101;
|
||||
+ case 109: /* vrsave */
|
||||
+ return 356;
|
||||
+ case 110: /* vscr */
|
||||
+ return 67;
|
||||
+ case 111: /* spe_acc */
|
||||
+ return 99;
|
||||
+ case 112: /* spefscr */
|
||||
+ return 612;
|
||||
+ default:
|
||||
+ return num;
|
||||
+ }
|
||||
+}
|
||||
+
|
||||
|
||||
static void
|
||||
rs6000_store_return_value (struct type *type,
|
||||
@@ -3471,6 +3536,10 @@ rs6000_gdbarch_init (struct gdbarch_info
|
||||
(gdbarch, rs6000_in_solib_return_trampoline);
|
||||
set_gdbarch_skip_trampoline_code (gdbarch, rs6000_skip_trampoline_code);
|
||||
|
||||
+ /* Hook in the DWARF CFI frame unwinder. */
|
||||
+ frame_unwind_append_sniffer (gdbarch, dwarf2_frame_sniffer);
|
||||
+ dwarf2_frame_set_adjust_regnum (gdbarch, rs6000_adjust_frame_regnum);
|
||||
+
|
||||
/* Hook in ABI-specific overrides, if they have been registered. */
|
||||
gdbarch_init_osabi (info, gdbarch);
|
||||
|
||||
|
@ -1,54 +0,0 @@
|
||||
From nobody Sun Dec 3 11:01:14 2006
|
||||
From: "H. J. Lu" <hjl@lucon.org>
|
||||
Subject: PATCH: PR tui/2173: Arrow keys no longer works in breakpoint command list
|
||||
To: GDB <gdb-patches@sources.redhat.com>
|
||||
Date: Tue, 21 Nov 2006 13:32:05 -0800
|
||||
|
||||
The problem is callback in readline 5.1 is changed. When gdb readline
|
||||
callback calls readline (), readline is really confused since although
|
||||
it is called from gdb callback, it isn't really in callback state. This
|
||||
kludge seems to work for me.
|
||||
|
||||
|
||||
H.J.
|
||||
----
|
||||
2006-11-21 H.J. Lu <hongjiu.lu@intel.com>
|
||||
|
||||
PR tui/2173
|
||||
* top.c (gdb_readline_wrapper): Unset and reset RL_STATE_CALLBACK
|
||||
around readline if needed.
|
||||
|
||||
--- gdb/top.c.arrow 2006-07-21 07:46:53.000000000 -0700
|
||||
+++ gdb/top.c 2006-11-21 13:20:04.000000000 -0800
|
||||
@@ -724,6 +724,9 @@ The filename in which to record the comm
|
||||
char *
|
||||
gdb_readline_wrapper (char *prompt)
|
||||
{
|
||||
+ char *line;
|
||||
+ int in_callback;
|
||||
+
|
||||
/* Set the hook that works in this case. */
|
||||
if (after_char_processing_hook)
|
||||
{
|
||||
@@ -731,7 +734,19 @@ gdb_readline_wrapper (char *prompt)
|
||||
after_char_processing_hook = NULL;
|
||||
}
|
||||
|
||||
- return readline (prompt);
|
||||
+ /* When we call readline, we have to make sure that readline isn't in
|
||||
+ the callback state. Otherwise, it will get really confused.
|
||||
+ PR tui/2173. */
|
||||
+ in_callback = RL_ISSTATE (RL_STATE_CALLBACK);
|
||||
+ if (in_callback)
|
||||
+ RL_UNSETSTATE (RL_STATE_CALLBACK);
|
||||
+
|
||||
+ line = readline (prompt);
|
||||
+
|
||||
+ if (in_callback)
|
||||
+ RL_SETSTATE (RL_STATE_CALLBACK);
|
||||
+
|
||||
+ return line;
|
||||
}
|
||||
|
||||
|
||||
|
@ -1,20 +0,0 @@
|
||||
2007-01-20 Daniel Jacobowitz <dan@codesourcery.com>
|
||||
|
||||
* arch-utils.c (show_endian): Correct reversed condition.
|
||||
|
||||
===================================================================
|
||||
RCS file: /cvs/src/src/gdb/arch-utils.c,v
|
||||
retrieving revision 1.138
|
||||
retrieving revision 1.139
|
||||
diff -u -r1.138 -r1.139
|
||||
--- src/gdb/arch-utils.c 2007/01/13 23:24:43 1.138
|
||||
+++ src/gdb/arch-utils.c 2007/01/20 18:31:29 1.139
|
||||
@@ -322,7 +322,7 @@
|
||||
show_endian (struct ui_file *file, int from_tty, struct cmd_list_element *c,
|
||||
const char *value)
|
||||
{
|
||||
- if (target_byte_order_user != BFD_ENDIAN_UNKNOWN)
|
||||
+ if (target_byte_order_user == BFD_ENDIAN_UNKNOWN)
|
||||
if (TARGET_BYTE_ORDER == BFD_ENDIAN_BIG)
|
||||
fprintf_unfiltered (file, _("The target endianness is set automatically "
|
||||
"(currently big endian)\n"));
|
@ -1,333 +0,0 @@
|
||||
--- gdb/solib-legacy.c.~1.11.~ 2007-01-10 11:18:50.000000000 +0100
|
||||
+++ gdb/solib-legacy.c 2007-03-29 12:56:05.000000000 +0200
|
||||
@@ -63,51 +63,28 @@ legacy_svr4_fetch_link_map_offsets (void
|
||||
lmo.link_map_size = sizeof (struct link_map);
|
||||
|
||||
lmo.l_addr_offset = offsetof (struct link_map, l_addr);
|
||||
- lmo.l_addr_size = fieldsize (struct link_map, l_addr);
|
||||
-
|
||||
lmo.l_next_offset = offsetof (struct link_map, l_next);
|
||||
- lmo.l_next_size = fieldsize (struct link_map, l_next);
|
||||
-
|
||||
lmo.l_ld_offset = offsetof (struct link_map, l_ld);
|
||||
- lmo.l_ld_size = fieldsize (struct link_map, l_ld);
|
||||
-
|
||||
lmo.l_prev_offset = offsetof (struct link_map, l_prev);
|
||||
- lmo.l_prev_size = fieldsize (struct link_map, l_prev);
|
||||
-
|
||||
lmo.l_name_offset = offsetof (struct link_map, l_name);
|
||||
- lmo.l_name_size = fieldsize (struct link_map, l_name);
|
||||
#else /* !defined(HAVE_STRUCT_LINK_MAP_WITH_L_MEMBERS) */
|
||||
#ifdef HAVE_STRUCT_LINK_MAP_WITH_LM_MEMBERS
|
||||
lmo.link_map_size = sizeof (struct link_map);
|
||||
|
||||
lmo.l_addr_offset = offsetof (struct link_map, lm_addr);
|
||||
- lmo.l_addr_size = fieldsize (struct link_map, lm_addr);
|
||||
-
|
||||
lmo.l_next_offset = offsetof (struct link_map, lm_next);
|
||||
- lmo.l_next_size = fieldsize (struct link_map, lm_next);
|
||||
-
|
||||
/* FIXME: Is this the right field name, or is it available at all? */
|
||||
lmo.l_ld_offset = offsetof (struct link_map, lm_ld);
|
||||
- lmo.l_ld_size = fieldsize (struct link_map, lm_ld);
|
||||
-
|
||||
lmo.l_name_offset = offsetof (struct link_map, lm_name);
|
||||
- lmo.l_name_size = fieldsize (struct link_map, lm_name);
|
||||
#else /* !defined(HAVE_STRUCT_LINK_MAP_WITH_LM_MEMBERS) */
|
||||
#if HAVE_STRUCT_SO_MAP_WITH_SOM_MEMBERS
|
||||
lmo.link_map_size = sizeof (struct so_map);
|
||||
|
||||
lmo.l_addr_offset = offsetof (struct so_map, som_addr);
|
||||
- lmo.l_addr_size = fieldsize (struct so_map, som_addr);
|
||||
-
|
||||
lmo.l_next_offset = offsetof (struct so_map, som_next);
|
||||
- lmo.l_next_size = fieldsize (struct so_map, som_next);
|
||||
-
|
||||
lmo.l_name_offset = offsetof (struct so_map, som_path);
|
||||
- lmo.l_name_size = fieldsize (struct so_map, som_path);
|
||||
-
|
||||
/* FIXME: Is the address of the dynamic table available? */
|
||||
- lmo.l_ld_offset = 0;
|
||||
- lmo.l_ld_size = 0;
|
||||
+ lmo.l_ld_offset = -1;
|
||||
#endif /* HAVE_STRUCT_SO_MAP_WITH_SOM_MEMBERS */
|
||||
#endif /* HAVE_STRUCT_LINK_MAP_WITH_LM_MEMBERS */
|
||||
#endif /* HAVE_STRUCT_LINK_MAP_WITH_L_MEMBERS */
|
||||
@@ -126,16 +103,9 @@ legacy_svr4_fetch_link_map_offsets (void
|
||||
lmo32.link_map_size = sizeof (struct link_map32);
|
||||
|
||||
lmo32.l_addr_offset = offsetof (struct link_map32, l_addr);
|
||||
- lmo32.l_addr_size = fieldsize (struct link_map32, l_addr);
|
||||
-
|
||||
lmo32.l_next_offset = offsetof (struct link_map32, l_next);
|
||||
- lmo32.l_next_size = fieldsize (struct link_map32, l_next);
|
||||
-
|
||||
lmo32.l_prev_offset = offsetof (struct link_map32, l_prev);
|
||||
- lmo32.l_prev_size = fieldsize (struct link_map32, l_prev);
|
||||
-
|
||||
lmo32.l_name_offset = offsetof (struct link_map32, l_name);
|
||||
- lmo32.l_name_size = fieldsize (struct link_map32, l_name);
|
||||
}
|
||||
#endif /* defined (HAVE_STRUCT_LINK_MAP32) */
|
||||
|
||||
--- gdb/solib-svr4.c.~1.61.~ 2007-03-27 21:15:04.000000000 +0200
|
||||
+++ gdb/solib-svr4.c 2007-03-29 12:56:47.000000000 +0200
|
||||
@@ -118,19 +118,6 @@ static char *main_name_list[] =
|
||||
NULL
|
||||
};
|
||||
|
||||
-/* Macro to extract an address from a solib structure. When GDB is
|
||||
- configured for some 32-bit targets (e.g. Solaris 2.7 sparc), BFD is
|
||||
- configured to handle 64-bit targets, so CORE_ADDR is 64 bits. We
|
||||
- have to extract only the significant bits of addresses to get the
|
||||
- right address when accessing the core file BFD.
|
||||
-
|
||||
- Assume that the address is unsigned. */
|
||||
-
|
||||
-#define SOLIB_EXTRACT_ADDRESS(MEMBER) \
|
||||
- extract_unsigned_integer (&(MEMBER), sizeof (MEMBER))
|
||||
-
|
||||
-/* local data declarations */
|
||||
-
|
||||
/* link map access functions */
|
||||
|
||||
static CORE_ADDR
|
||||
@@ -138,9 +125,8 @@ LM_ADDR_FROM_LINK_MAP (struct so_list *s
|
||||
{
|
||||
struct link_map_offsets *lmo = svr4_fetch_link_map_offsets ();
|
||||
|
||||
- return (CORE_ADDR) extract_signed_integer (so->lm_info->lm
|
||||
- + lmo->l_addr_offset,
|
||||
- lmo->l_addr_size);
|
||||
+ return extract_typed_address (so->lm_info->lm + lmo->l_addr_offset,
|
||||
+ builtin_type_void_data_ptr);
|
||||
}
|
||||
|
||||
static int
|
||||
@@ -148,7 +134,7 @@ HAS_LM_DYNAMIC_FROM_LINK_MAP ()
|
||||
{
|
||||
struct link_map_offsets *lmo = svr4_fetch_link_map_offsets ();
|
||||
|
||||
- return (lmo->l_ld_size != 0);
|
||||
+ return lmo->l_ld_offset >= 0;
|
||||
}
|
||||
|
||||
static CORE_ADDR
|
||||
@@ -156,11 +142,8 @@ LM_DYNAMIC_FROM_LINK_MAP (struct so_list
|
||||
{
|
||||
struct link_map_offsets *lmo = svr4_fetch_link_map_offsets ();
|
||||
|
||||
- gdb_assert (lmo->l_ld_size != 0);
|
||||
-
|
||||
- return (CORE_ADDR) extract_signed_integer (so->lm_info->lm
|
||||
- + lmo->l_ld_offset,
|
||||
- lmo->l_ld_size);
|
||||
+ return extract_typed_address (so->lm_info->lm + lmo->l_ld_offset,
|
||||
+ builtin_type_void_data_ptr);
|
||||
}
|
||||
|
||||
static CORE_ADDR
|
||||
@@ -238,9 +221,8 @@ LM_NEXT (struct so_list *so)
|
||||
{
|
||||
struct link_map_offsets *lmo = svr4_fetch_link_map_offsets ();
|
||||
|
||||
- /* Assume that the address is unsigned. */
|
||||
- return extract_unsigned_integer (so->lm_info->lm + lmo->l_next_offset,
|
||||
- lmo->l_next_size);
|
||||
+ return extract_typed_address (so->lm_info->lm + lmo->l_next_offset,
|
||||
+ builtin_type_void_data_ptr);
|
||||
}
|
||||
|
||||
static CORE_ADDR
|
||||
@@ -248,9 +230,8 @@ LM_NAME (struct so_list *so)
|
||||
{
|
||||
struct link_map_offsets *lmo = svr4_fetch_link_map_offsets ();
|
||||
|
||||
- /* Assume that the address is unsigned. */
|
||||
- return extract_unsigned_integer (so->lm_info->lm + lmo->l_name_offset,
|
||||
- lmo->l_name_size);
|
||||
+ return extract_typed_address (so->lm_info->lm + lmo->l_name_offset,
|
||||
+ builtin_type_void_data_ptr);
|
||||
}
|
||||
|
||||
static int
|
||||
@@ -258,9 +239,8 @@ IGNORE_FIRST_LINK_MAP_ENTRY (struct so_l
|
||||
{
|
||||
struct link_map_offsets *lmo = svr4_fetch_link_map_offsets ();
|
||||
|
||||
- /* Assume that the address is unsigned. */
|
||||
- return extract_unsigned_integer (so->lm_info->lm + lmo->l_prev_offset,
|
||||
- lmo->l_prev_size) == 0;
|
||||
+ return extract_typed_address (so->lm_info->lm + lmo->l_prev_offset,
|
||||
+ builtin_type_void_data_ptr) == 0;
|
||||
}
|
||||
|
||||
static CORE_ADDR debug_base; /* Base of dynamic linker structures */
|
||||
@@ -446,7 +426,7 @@ elf_locate_base (void)
|
||||
else if (dyn_tag == DT_MIPS_RLD_MAP)
|
||||
{
|
||||
gdb_byte *pbuf;
|
||||
- int pbuf_size = TARGET_PTR_BIT / HOST_CHAR_BIT;
|
||||
+ int pbuf_size = TYPE_LENGTH (builtin_type_void_data_ptr);
|
||||
|
||||
pbuf = alloca (pbuf_size);
|
||||
/* DT_MIPS_RLD_MAP contains a pointer to the address
|
||||
@@ -455,7 +435,7 @@ elf_locate_base (void)
|
||||
(bfd_byte *) x_dynp->d_un.d_ptr);
|
||||
if (target_read_memory (dyn_ptr, pbuf, pbuf_size))
|
||||
return 0;
|
||||
- return extract_unsigned_integer (pbuf, pbuf_size);
|
||||
+ return extract_typed_address (pbuf, builtin_type_void_data_ptr);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -481,7 +461,7 @@ elf_locate_base (void)
|
||||
else if (dyn_tag == DT_MIPS_RLD_MAP)
|
||||
{
|
||||
gdb_byte *pbuf;
|
||||
- int pbuf_size = TARGET_PTR_BIT / HOST_CHAR_BIT;
|
||||
+ int pbuf_size = TYPE_LENGTH (builtin_type_void_data_ptr);
|
||||
|
||||
pbuf = alloca (pbuf_size);
|
||||
/* DT_MIPS_RLD_MAP contains a pointer to the address
|
||||
@@ -490,7 +470,7 @@ elf_locate_base (void)
|
||||
(bfd_byte *) x_dynp->d_un.d_ptr);
|
||||
if (target_read_memory (dyn_ptr, pbuf, pbuf_size))
|
||||
return 0;
|
||||
- return extract_unsigned_integer (pbuf, pbuf_size);
|
||||
+ return extract_typed_address (pbuf, builtin_type_void_data_ptr);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -620,7 +600,8 @@ open_symbol_file_object (void *from_ttyp
|
||||
int errcode;
|
||||
int from_tty = *(int *)from_ttyp;
|
||||
struct link_map_offsets *lmo = svr4_fetch_link_map_offsets ();
|
||||
- gdb_byte *l_name_buf = xmalloc (lmo->l_name_size);
|
||||
+ int l_name_size = TYPE_LENGTH (builtin_type_void_data_ptr);
|
||||
+ gdb_byte *l_name_buf = xmalloc (l_name_size);
|
||||
struct cleanup *cleanups = make_cleanup (xfree, l_name_buf);
|
||||
|
||||
if (symfile_objfile)
|
||||
@@ -636,11 +617,10 @@ open_symbol_file_object (void *from_ttyp
|
||||
return 0; /* failed somehow... */
|
||||
|
||||
/* Read address of name from target memory to GDB. */
|
||||
- read_memory (lm + lmo->l_name_offset, l_name_buf, lmo->l_name_size);
|
||||
+ read_memory (lm + lmo->l_name_offset, l_name_buf, l_name_size);
|
||||
|
||||
- /* Convert the address to host format. Assume that the address is
|
||||
- unsigned. */
|
||||
- l_name = extract_unsigned_integer (l_name_buf, lmo->l_name_size);
|
||||
+ /* Convert the address to host format. */
|
||||
+ l_name = extract_typed_address (l_name_buf, builtin_type_void_data_ptr);
|
||||
|
||||
/* Free l_name_buf. */
|
||||
do_cleanups (cleanups);
|
||||
@@ -836,7 +816,8 @@ svr4_fetch_objfile_link_map (struct objf
|
||||
struct lm_info objfile_lm_info;
|
||||
struct cleanup *old_chain;
|
||||
CORE_ADDR name_address;
|
||||
- gdb_byte *l_name_buf = xmalloc (lmo->l_name_size);
|
||||
+ int l_name_size = TYPE_LENGTH (builtin_type_void_data_ptr);
|
||||
+ gdb_byte *l_name_buf = xmalloc (l_name_size);
|
||||
old_chain = make_cleanup (xfree, l_name_buf);
|
||||
|
||||
/* Set up the buffer to contain the portion of the link_map
|
||||
@@ -849,11 +830,11 @@ svr4_fetch_objfile_link_map (struct objf
|
||||
read_memory (lm, objfile_lm_info.lm, lmo->link_map_size);
|
||||
|
||||
/* Read address of name from target memory to GDB. */
|
||||
- read_memory (lm + lmo->l_name_offset, l_name_buf, lmo->l_name_size);
|
||||
+ read_memory (lm + lmo->l_name_offset, l_name_buf, l_name_size);
|
||||
|
||||
- /* Extract this object's name. Assume that the address is
|
||||
- unsigned. */
|
||||
- name_address = extract_unsigned_integer (l_name_buf, lmo->l_name_size);
|
||||
+ /* Extract this object's name. */
|
||||
+ name_address = extract_typed_address (l_name_buf,
|
||||
+ builtin_type_void_data_ptr);
|
||||
target_read_string (name_address, &buffer,
|
||||
SO_NAME_MAX_PATH_SIZE - 1, &errcode);
|
||||
make_cleanup (xfree, buffer);
|
||||
@@ -872,10 +853,9 @@ svr4_fetch_objfile_link_map (struct objf
|
||||
return lm;
|
||||
}
|
||||
}
|
||||
- /* Not the file we wanted, continue checking. Assume that the
|
||||
- address is unsigned. */
|
||||
- lm = extract_unsigned_integer (objfile_lm_info.lm + lmo->l_next_offset,
|
||||
- lmo->l_next_size);
|
||||
+ /* Not the file we wanted, continue checking. */
|
||||
+ lm = extract_typed_address (objfile_lm_info.lm + lmo->l_next_offset,
|
||||
+ builtin_type_void_data_ptr);
|
||||
do_cleanups (old_chain);
|
||||
}
|
||||
return 0;
|
||||
@@ -1521,15 +1501,10 @@ svr4_ilp32_fetch_link_map_offsets (void)
|
||||
/* Everything we need is in the first 20 bytes. */
|
||||
lmo.link_map_size = 20;
|
||||
lmo.l_addr_offset = 0;
|
||||
- lmo.l_addr_size = 4;
|
||||
lmo.l_name_offset = 4;
|
||||
- lmo.l_name_size = 4;
|
||||
lmo.l_ld_offset = 8;
|
||||
- lmo.l_ld_size = 4;
|
||||
lmo.l_next_offset = 12;
|
||||
- lmo.l_next_size = 4;
|
||||
lmo.l_prev_offset = 16;
|
||||
- lmo.l_prev_size = 4;
|
||||
}
|
||||
|
||||
return lmp;
|
||||
@@ -1556,15 +1531,10 @@ svr4_lp64_fetch_link_map_offsets (void)
|
||||
/* Everything we need is in the first 40 bytes. */
|
||||
lmo.link_map_size = 40;
|
||||
lmo.l_addr_offset = 0;
|
||||
- lmo.l_addr_size = 8;
|
||||
lmo.l_name_offset = 8;
|
||||
- lmo.l_name_size = 8;
|
||||
lmo.l_ld_offset = 16;
|
||||
- lmo.l_ld_size = 8;
|
||||
lmo.l_next_offset = 24;
|
||||
- lmo.l_next_size = 8;
|
||||
lmo.l_prev_offset = 32;
|
||||
- lmo.l_prev_size = 8;
|
||||
}
|
||||
|
||||
return lmp;
|
||||
--- gdb/solib-svr4.h.~1.13.~ 2007-01-10 11:18:50.000000000 +0100
|
||||
+++ gdb/solib-svr4.h 2007-03-28 16:00:34.000000000 +0200
|
||||
@@ -46,32 +46,18 @@ struct link_map_offsets
|
||||
/* Offset to l_addr field in struct link_map. */
|
||||
int l_addr_offset;
|
||||
|
||||
- /* Size of l_addr field in struct link_map. */
|
||||
- int l_addr_size;
|
||||
-
|
||||
/* Offset to l_ld field in struct link_map. */
|
||||
int l_ld_offset;
|
||||
|
||||
- /* Size of l_ld field in struct link_map. */
|
||||
- int l_ld_size;
|
||||
-
|
||||
/* Offset to l_next field in struct link_map. */
|
||||
int l_next_offset;
|
||||
|
||||
- /* Size of l_next field in struct link_map. */
|
||||
- int l_next_size;
|
||||
-
|
||||
/* Offset to l_prev field in struct link_map. */
|
||||
int l_prev_offset;
|
||||
|
||||
- /* Size of l_prev field in struct link_map. */
|
||||
- int l_prev_size;
|
||||
-
|
||||
/* Offset to l_name field in struct link_map. */
|
||||
int l_name_offset;
|
||||
|
||||
- /* Size of l_name field in struct link_map. */
|
||||
- int l_name_size;
|
||||
};
|
||||
|
||||
/* set_solib_svr4_fetch_link_map_offsets() is intended to be called by
|
232
warn.patch
232
warn.patch
@ -1,235 +1,3 @@
|
||||
--- gdb/remote.c
|
||||
+++ gdb/remote.c
|
||||
@@ -966,8 +966,8 @@
|
||||
static int use_threadextra_query;
|
||||
|
||||
/* Tokens for use by the asynchronous signal handlers for SIGINT. */
|
||||
-static void *sigint_remote_twice_token;
|
||||
-static void *sigint_remote_token;
|
||||
+static struct async_signal_handler *sigint_remote_twice_token;
|
||||
+static struct async_signal_handler *sigint_remote_token;
|
||||
|
||||
/* These are pointers to hook functions that may be set in order to
|
||||
modify resume/wait behavior for a particular architecture. */
|
||||
@@ -2843,11 +2843,9 @@
|
||||
{
|
||||
signal (SIGINT, handle_sigint);
|
||||
if (sigint_remote_twice_token)
|
||||
- delete_async_signal_handler ((struct async_signal_handler **)
|
||||
- &sigint_remote_twice_token);
|
||||
+ delete_async_signal_handler (&sigint_remote_twice_token);
|
||||
if (sigint_remote_token)
|
||||
- delete_async_signal_handler ((struct async_signal_handler **)
|
||||
- &sigint_remote_token);
|
||||
+ delete_async_signal_handler (&sigint_remote_token);
|
||||
}
|
||||
|
||||
/* Send ^C to target to halt it. Target will respond, and send us a
|
||||
--- gdb/tui/tui-layout.c
|
||||
+++ gdb/tui/tui-layout.c
|
||||
@@ -47,7 +47,7 @@
|
||||
********************************/
|
||||
static void show_layout (enum tui_layout_type);
|
||||
static void init_gen_win_info (struct tui_gen_win_info *, enum tui_win_type, int, int, int, int);
|
||||
-static void init_and_make_win (void **, enum tui_win_type, int, int, int, int, int);
|
||||
+static void init_and_make_win (struct tui_gen_win_info **, enum tui_win_type, int, int, int, int, int);
|
||||
static void show_source_or_disasm_and_command (enum tui_layout_type);
|
||||
static void make_source_or_disasm_window (struct tui_win_info * *, enum tui_win_type, int, int);
|
||||
static void make_command_window (struct tui_win_info * *, int, int);
|
||||
@@ -640,13 +640,13 @@
|
||||
static void
|
||||
make_command_window (struct tui_win_info * * win_info_ptr, int height, int origin_y)
|
||||
{
|
||||
- init_and_make_win ((void **) win_info_ptr,
|
||||
- CMD_WIN,
|
||||
- height,
|
||||
- tui_term_width (),
|
||||
- 0,
|
||||
- origin_y,
|
||||
- DONT_BOX_WINDOW);
|
||||
+ init_and_make_win ((struct tui_gen_win_info **) win_info_ptr,
|
||||
+ CMD_WIN,
|
||||
+ height,
|
||||
+ tui_term_width (),
|
||||
+ 0,
|
||||
+ origin_y,
|
||||
+ DONT_BOX_WINDOW);
|
||||
|
||||
(*win_info_ptr)->can_highlight = FALSE;
|
||||
}
|
||||
@@ -679,13 +679,13 @@
|
||||
static void
|
||||
make_data_window (struct tui_win_info * * win_info_ptr, int height, int origin_y)
|
||||
{
|
||||
- init_and_make_win ((void **) win_info_ptr,
|
||||
- DATA_WIN,
|
||||
- height,
|
||||
- tui_term_width (),
|
||||
- 0,
|
||||
- origin_y,
|
||||
- BOX_WINDOW);
|
||||
+ init_and_make_win ((struct tui_gen_win_info **) win_info_ptr,
|
||||
+ DATA_WIN,
|
||||
+ height,
|
||||
+ tui_term_width (),
|
||||
+ 0,
|
||||
+ origin_y,
|
||||
+ BOX_WINDOW);
|
||||
}
|
||||
|
||||
|
||||
@@ -751,13 +751,13 @@
|
||||
if (TUI_DISASM_WIN == NULL)
|
||||
{
|
||||
make_disasm_window (&TUI_DISASM_WIN, asm_height, src_height - 1);
|
||||
- init_and_make_win ((void **) & locator,
|
||||
- LOCATOR_WIN,
|
||||
- 2 /* 1 */ ,
|
||||
- tui_term_width (),
|
||||
- 0,
|
||||
- (src_height + asm_height) - 1,
|
||||
- DONT_BOX_WINDOW);
|
||||
+ init_and_make_win (&locator,
|
||||
+ LOCATOR_WIN,
|
||||
+ 2 /* 1 */ ,
|
||||
+ tui_term_width (),
|
||||
+ 0,
|
||||
+ (src_height + asm_height) - 1,
|
||||
+ DONT_BOX_WINDOW);
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -844,13 +844,13 @@
|
||||
make_source_window (&tui_win_list[win_type], src_height, data_height - 1);
|
||||
else
|
||||
make_disasm_window (&tui_win_list[win_type], src_height, data_height - 1);
|
||||
- init_and_make_win ((void **) & locator,
|
||||
- LOCATOR_WIN,
|
||||
- 2 /* 1 */ ,
|
||||
- tui_term_width (),
|
||||
- 0,
|
||||
- total_height - 1,
|
||||
- DONT_BOX_WINDOW);
|
||||
+ init_and_make_win (&locator,
|
||||
+ LOCATOR_WIN,
|
||||
+ 2 /* 1 */ ,
|
||||
+ tui_term_width (),
|
||||
+ 0,
|
||||
+ total_height - 1,
|
||||
+ DONT_BOX_WINDOW);
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -912,37 +912,25 @@
|
||||
** init_and_make_win().
|
||||
*/
|
||||
static void
|
||||
-init_and_make_win (void ** win_info_ptr, enum tui_win_type win_type,
|
||||
- int height, int width, int origin_x, int origin_y, int box_it)
|
||||
+init_and_make_win (struct tui_gen_win_info **win_info_ptr,
|
||||
+ enum tui_win_type win_type, int height, int width,
|
||||
+ int origin_x, int origin_y, int box_it)
|
||||
{
|
||||
- void *opaque_win_info = *win_info_ptr;
|
||||
- struct tui_gen_win_info * generic;
|
||||
+ struct tui_gen_win_info *generic = *win_info_ptr;
|
||||
|
||||
- if (opaque_win_info == NULL)
|
||||
+ if (generic == NULL)
|
||||
{
|
||||
if (tui_win_is_auxillary (win_type))
|
||||
- opaque_win_info = (void *) tui_alloc_generic_win_info ();
|
||||
+ generic = tui_alloc_generic_win_info ();
|
||||
else
|
||||
- opaque_win_info = (void *) tui_alloc_win_info (win_type);
|
||||
- }
|
||||
- if (tui_win_is_auxillary (win_type))
|
||||
- generic = (struct tui_gen_win_info *) opaque_win_info;
|
||||
- else
|
||||
- generic = &((struct tui_win_info *) opaque_win_info)->generic;
|
||||
-
|
||||
- if (opaque_win_info != NULL)
|
||||
- {
|
||||
- init_gen_win_info (generic, win_type, height, width, origin_x, origin_y);
|
||||
- if (!tui_win_is_auxillary (win_type))
|
||||
- {
|
||||
- if (generic->type == CMD_WIN)
|
||||
- ((struct tui_win_info *) opaque_win_info)->can_highlight = FALSE;
|
||||
- else
|
||||
- ((struct tui_win_info *) opaque_win_info)->can_highlight = TRUE;
|
||||
- }
|
||||
- tui_make_window (generic, box_it);
|
||||
+ generic = &tui_alloc_win_info (win_type)->generic;
|
||||
+ *win_info_ptr = generic;
|
||||
}
|
||||
- *win_info_ptr = opaque_win_info;
|
||||
+ init_gen_win_info (generic, win_type, height, width, origin_x, origin_y);
|
||||
+ if (!tui_win_is_auxillary (win_type))
|
||||
+ ((struct tui_win_info *) generic)->can_highlight
|
||||
+ = generic->type != CMD_WIN;
|
||||
+ tui_make_window (generic, box_it);
|
||||
}
|
||||
|
||||
|
||||
@@ -959,23 +947,23 @@
|
||||
execution_info = tui_source_exec_info_win_ptr ();
|
||||
else
|
||||
execution_info = tui_disassem_exec_info_win_ptr ();
|
||||
- init_and_make_win ((void **) & execution_info,
|
||||
- EXEC_INFO_WIN,
|
||||
- height,
|
||||
- 3,
|
||||
- 0,
|
||||
- origin_y,
|
||||
- DONT_BOX_WINDOW);
|
||||
+ init_and_make_win (&execution_info,
|
||||
+ EXEC_INFO_WIN,
|
||||
+ height,
|
||||
+ 3,
|
||||
+ 0,
|
||||
+ origin_y,
|
||||
+ DONT_BOX_WINDOW);
|
||||
/*
|
||||
** Now create the source window.
|
||||
*/
|
||||
- init_and_make_win ((void **) win_info_ptr,
|
||||
- type,
|
||||
- height,
|
||||
- tui_term_width () - execution_info->width,
|
||||
- execution_info->width,
|
||||
- origin_y,
|
||||
- BOX_WINDOW);
|
||||
+ init_and_make_win ((struct tui_gen_win_info **) win_info_ptr,
|
||||
+ type,
|
||||
+ height,
|
||||
+ tui_term_width () - execution_info->width,
|
||||
+ execution_info->width,
|
||||
+ origin_y,
|
||||
+ BOX_WINDOW);
|
||||
|
||||
(*win_info_ptr)->detail.source_info.execution_info = execution_info;
|
||||
}
|
||||
@@ -1009,13 +997,13 @@
|
||||
make_source_window (win_info_ptr, src_height - 1, 0);
|
||||
else
|
||||
make_disasm_window (win_info_ptr, src_height - 1, 0);
|
||||
- init_and_make_win ((void **) & locator,
|
||||
- LOCATOR_WIN,
|
||||
- 2 /* 1 */ ,
|
||||
- tui_term_width (),
|
||||
- 0,
|
||||
- src_height - 1,
|
||||
- DONT_BOX_WINDOW);
|
||||
+ init_and_make_win (&locator,
|
||||
+ LOCATOR_WIN,
|
||||
+ 2 /* 1 */ ,
|
||||
+ tui_term_width (),
|
||||
+ 0,
|
||||
+ src_height - 1,
|
||||
+ DONT_BOX_WINDOW);
|
||||
}
|
||||
else
|
||||
{
|
||||
--- sim/common/gentmap.c
|
||||
+++ sim/common/gentmap.c
|
||||
@@ -2,6 +2,7 @@
|
||||
|
Loading…
x
Reference in New Issue
Block a user