* command.c (do_setshow_command): Use %u with var_{u,z}integer.
* command.{c,h}: New var_type var_integer.
main.c: Use it for history_size.
* rs6000-tdep.c, xcoffexec.c, config/rs6000/xm-rs6000.h, breakpoint.c:
Lint and byte-order fixups.
Tue Mar 30 08:06:24 1993 Jim Kingdon (kingdon@cygnus.com)
+ * command.c (do_setshow_command): Use %u with var_{u,z}integer.
+
+ * command.{c,h}: New var_type var_integer.
+ main.c: Use it for history_size.
+
+ * rs6000-tdep.c, xcoffexec.c, config/rs6000/xm-rs6000.h, breakpoint.c:
+ Lint and byte-order fixups.
+
* breakpoint.c (print_it_normal): Return 0 after hitting watchpoint.
* breakpoint.h (bpstat): New field print_it.
"Error evaluating expression for watchpoint %d\n";
char message[sizeof (message1) + 30 /* slop */];
sprintf (message, message1, b->number);
- switch (catch_errors (watchpoint_check, bs, message))
+ switch (catch_errors (watchpoint_check, (char *) bs, message))
{
case WP_DISABLED:
/* We've already printed what needs to be printed. */
if (*(unsigned int *) c->var == 0)
*(unsigned int *) c->var = UINT_MAX;
break;
+ case var_integer:
+ {
+ unsigned int val;
+ if (arg == NULL)
+ error_no_arg ("integer to set it to.");
+ val = parse_and_eval_address (arg);
+ if (val == 0)
+ *(int *) c->var = INT_MAX;
+ else if (val >= INT_MAX)
+ error ("integer %u out of range", val);
+ else
+ *(int *) c->var = val;
+ break;
+ }
case var_zinteger:
if (arg == NULL)
error_no_arg ("integer to set it to.");
}
/* else fall through */
case var_zinteger:
- fprintf_filtered (stdout, "%d", *(unsigned int *) c->var);
+ fprintf_filtered (stdout, "%u", *(unsigned int *) c->var);
break;
+ case var_integer:
+ if (*(int *) c->var == INT_MAX)
+ {
+ fputs_filtered ("unlimited", stdout);
+ }
+ else
+ fprintf_filtered (stdout, "%d", *(int *) c->var);
+ break;
+
default:
error ("gdb internal error: bad var_type in do_setshow_command");
}
#define SIGWINCH_HANDLER aix_resizewindow
extern void aix_resizewindow ();
+/* This doesn't seem to be declared in any header file I can find. */
+char *termdef PARAMS ((int, int));
+
/* `lines_per_page' and `chars_per_line' are local to utils.c. Rectify this. */
#define SIGWINCH_HANDLER_BODY \
if (!one_stepped) {
loc = read_pc ();
- read_memory (loc, &insn, 4);
+ read_memory (loc, (char *) &insn, 4);
breaks[0] = loc + INSNLEN(insn);
opcode = insn >> 26;
void
push_dummy_frame ()
{
- int sp, pc; /* stack pointer and link register */
+ /* stack pointer. */
+ CORE_ADDR sp;
+
+ /* link register. */
+ CORE_ADDR pc;
+ /* Same thing, target byte order. */
+ char pc_targ[4];
+
int ii;
target_fetch_registers (-1);
}
sp = read_register(SP_REGNUM);
- pc = read_register(PC_REGNUM);
+ pc = read_register(PC_REGNUM);
+ memcpy (pc_targ, (char *) &pc, 4);
dummy_frame_addr [dummy_frame_count++] = sp;
set_current_frame (create_new_frame (sp-DUMMY_FRAME_SIZE, pc));
/* save program counter in link register's space. */
- write_memory (sp+8, &pc, 4);
+ write_memory (sp+8, pc_targ, 4);
/* save all floating point and general purpose registers here. */
sp -= DUMMY_FRAME_SIZE;
/* And finally, this is the back chain. */
- write_memory (sp+8, &pc, 4);
+ write_memory (sp+8, pc_targ, 4);
}
void
pop_frame ()
{
- int pc, lr, sp, prev_sp; /* %pc, %lr, %sp */
+ CORE_ADDR pc, lr, sp, prev_sp; /* %pc, %lr, %sp */
struct aix_framedata fdata;
FRAME fr = get_current_frame ();
int addr, ii;
addr = get_pc_function_start (fr->pc) + FUNCTION_START_OFFSET;
function_frame_info (addr, &fdata);
- read_memory (sp, &prev_sp, 4);
+ prev_sp = read_memory_integer (sp, 4);
if (fdata.frameless)
lr = read_register (LR_REGNUM);
else
- read_memory (prev_sp+8, &lr, 4);
+ lr = read_memory_integer (prev_sp+8, 4);
/* reset %pc value. */
write_register (PC_REGNUM, lr);
++f_argno;
}
- write_memory (sp+24+(ii*4), VALUE_CONTENTS (arg), len);
+ write_memory (sp+24+(ii*4), (char *) VALUE_CONTENTS (arg), len);
ii += ((len + 3) & -4) / 4;
}
}
for (ii=0; trampoline_code[ii]; ++ii) {
op = read_memory_integer (pc + (ii*4), 4);
if (op != trampoline_code [ii])
- return NULL;
+ return 0;
}
ii = read_register (11); /* r11 holds destination addr */
pc = read_memory_integer (ii, 4); /* (r11) value */
vmap_ldinfo(ldi);
do {
- add_text_to_loadinfo (ldi->ldinfo_textorg, ldi->ldinfo_dataorg);
+ /* We are allowed to assume CORE_ADDR == pointer. This code is
+ native only. */
+ add_text_to_loadinfo ((CORE_ADDR) ldi->ldinfo_textorg,
+ (CORE_ADDR) ldi->ldinfo_dataorg);
} while (ldi->ldinfo_next
&& (ldi = (void *) (ldi->ldinfo_next + (char *) ldi)));
}
\f
void
-sex_to_vmap(bfd *bf, sec_ptr sex, struct vmap_and_bfd *vmap_bfd)
+sex_to_vmap(bfd *bf, sec_ptr sex, PTR arg3)
{
+ struct vmap_and_bfd *vmap_bfd = (struct vmap_and_bfd *)arg3;
register struct vmap *vp, **vpp;
register struct symtab *syms;
bfd *arch = vmap_bfd->pbfd;
/* found a corresponding VMAP. remap! */
ostart = vp->tstart;
- vp->tstart = ldi->ldinfo_textorg;
+ /* We can assume pointer == CORE_ADDR, this code is native only. */
+ vp->tstart = (CORE_ADDR) ldi->ldinfo_textorg;
vp->tend = vp->tstart + ldi->ldinfo_textsize;
- vp->dstart = ldi->ldinfo_dataorg;
+ vp->dstart = (CORE_ADDR) ldi->ldinfo_dataorg;
vp->dend = vp->dstart + ldi->ldinfo_datasize;
if (vp->tadj) {
offset += ldip->ldinfo_next;
- vp->tstart = ldip->ldinfo_textorg;
+ /* We can assume pointer == CORE_ADDR, this code is native only. */
+ vp->tstart = (CORE_ADDR) ldip->ldinfo_textorg;
vp->tend = vp->tstart + ldip->ldinfo_textsize;
- vp->dstart = ldip->ldinfo_dataorg;
+ vp->dstart = (CORE_ADDR) ldip->ldinfo_dataorg;
vp->dend = vp->dstart + ldip->ldinfo_datasize;
if (vp->tadj != 0) {
vmap_symtab (vp);
- add_text_to_loadinfo (ldip->ldinfo_textorg, ldip->ldinfo_dataorg);
+ add_text_to_loadinfo ((CORE_ADDR)ldip->ldinfo_textorg,
+ (CORE_ADDR)ldip->ldinfo_dataorg);
} while (ldip->ldinfo_next != 0);
vmap_exec ();
do_cleanups (old);