* target.c: White space.
* target-descriptions.c: White space.
* target-memory.c: White space.
* thread.c: White space.
* top.c: White space.
* tracepoint.c: White space.
* trad-frame.c: White space.
* tramp-frame.c: White space.
* ui-file.c: White space.
* ui-out.c: White space.
* user-regs.c: White space.
* utils.c: White space.
2010-05-16 Michael Snyder <msnyder@vmware.com>
+ * target.c: White space.
+ * target-descriptions.c: White space.
+ * target-memory.c: White space.
+ * thread.c: White space.
+ * top.c: White space.
+ * tracepoint.c: White space.
+ * trad-frame.c: White space.
+ * tramp-frame.c: White space.
+ * ui-file.c: White space.
+ * ui-out.c: White space.
+ * user-regs.c: White space.
+ * utils.c: White space.
+
* scm-exp.c: White space.
* scm-lang.c: White space.
* scm-valprint.c: White space.
tdesc_find_register (struct gdbarch *gdbarch, int regno)
{
struct tdesc_arch_reg *reg = tdesc_find_arch_register (gdbarch, regno);
+
return reg? reg->reg : NULL;
}
if (regno >= num_regs && regno < num_regs + num_pseudo_regs)
{
struct tdesc_arch_data *data = gdbarch_data (gdbarch, tdesc_data);
+
gdb_assert (data->pseudo_register_name != NULL);
return data->pseudo_register_name (gdbarch, regno);
}
if (reg == NULL && regno >= num_regs && regno < num_regs + num_pseudo_regs)
{
struct tdesc_arch_data *data = gdbarch_data (gdbarch, tdesc_data);
+
gdb_assert (data->pseudo_register_type != NULL);
return data->pseudo_register_type (gdbarch, regno);
}
if (regno >= num_regs && regno < num_regs + num_pseudo_regs)
{
struct tdesc_arch_data *data = gdbarch_data (gdbarch, tdesc_data);
+
if (data->pseudo_register_reggroup_p != NULL)
return data->pseudo_register_reggroup_p (gdbarch, regno, reggroup);
/* Otherwise fall through to the default reggroup_p. */
static void
tdesc_free_type (struct tdesc_type *type)
{
-
switch (type->kind)
{
case TDESC_TYPE_STRUCT:
{
struct memory_write_request *n =
VEC_safe_push (memory_write_request_s, *result, NULL);
+
*n = *r;
n->begin = claimed_begin;
n->end = claimed_end;
while (1)
{
VEC(memory_write_request_s) **r;
- region = lookup_mem_region (cur_address);
+ region = lookup_mem_region (cur_address);
r = region->attrib.mode == MEM_FLASH ? flash_blocks : regular_blocks;
cur_address = region->hi;
claim_memory (blocks, r, region->lo, region->hi);
{
struct memory_write_request *n =
VEC_safe_push (memory_write_request_s, result, NULL);
+
memset (n, 0, sizeof (struct memory_write_request));
n->begin = begin;
n->end = end;
{
struct memory_write_request *n =
VEC_safe_push (memory_write_request_s, result, NULL);
+
memset (n, 0, sizeof (struct memory_write_request));
n->begin = erased.begin;
n->end = written->begin;
cleanup_write_requests_vector (void *p)
{
VEC(memory_write_request_s) **v = p;
+
VEC_free (memory_write_request_s, *v);
}
char **env, int from_tty)
{
struct target_ops *t;
+
for (t = current_target.beneath; t != NULL; t = t->beneath)
{
if (t->to_create_inferior != NULL)
/* There's already something at this stratum level. Close it,
and un-hook it from the stack. */
struct target_ops *tmp = (*cur);
+
(*cur) = (*cur)->beneath;
tmp->beneath = NULL;
target_close (tmp, 0);
fprintf_unfiltered (gdb_stderr,
"pop_target couldn't find target %s\n",
current_target.to_shortname);
- internal_error (__FILE__, __LINE__, _("failed internal consistency check"));
+ internal_error (__FILE__, __LINE__,
+ _("failed internal consistency check"));
}
void
if (bufptr - buffer + tlen > buffer_allocated)
{
unsigned int bytes;
+
bytes = bufptr - buffer;
buffer_allocated *= 2;
buffer = xrealloc (buffer, buffer_allocated);
if (readbuf != NULL && overlay_debugging)
{
struct obj_section *section = find_pc_overlay (memaddr);
+
if (pc_in_unmapped_range (memaddr, section))
{
struct target_section_table *table
= target_get_section_table (ops);
const char *section_name = section->the_bfd_section->name;
+
memaddr = overlay_mapped_address (memaddr, section);
return section_table_xfer_memory_partial (readbuf, writebuf,
memaddr, len,
make_show_memory_breakpoints_cleanup (int show)
{
int current = show_memory_breakpoints;
- show_memory_breakpoints = show;
+ show_memory_breakpoints = show;
return make_cleanup (restore_show_memory_breakpoints,
(void *) (uintptr_t) current);
}
for (t = current_target.beneath; t != NULL; t = t->beneath)
if (t->to_flash_erase != NULL)
- {
- if (targetdebug)
- fprintf_unfiltered (gdb_stdlog, "target_flash_erase (%s, %s)\n",
- hex_string (address), phex (length, 0));
- t->to_flash_erase (t, address, length);
- return;
- }
+ {
+ if (targetdebug)
+ fprintf_unfiltered (gdb_stdlog, "target_flash_erase (%s, %s)\n",
+ hex_string (address), phex (length, 0));
+ t->to_flash_erase (t, address, length);
+ return;
+ }
tcomplain ();
}
for (t = current_target.beneath; t != NULL; t = t->beneath)
if (t->to_flash_done != NULL)
- {
- if (targetdebug)
- fprintf_unfiltered (gdb_stdlog, "target_flash_done\n");
- t->to_flash_done (t);
- return;
- }
+ {
+ if (targetdebug)
+ fprintf_unfiltered (gdb_stdlog, "target_flash_done\n");
+ t->to_flash_done (t);
+ return;
+ }
tcomplain ();
}
"deprecated_xfer_memory" method. */
{
int xfered = -1;
+
errno = 0;
if (writebuf != NULL)
{
void *buffer = xmalloc (len);
struct cleanup *cleanup = make_cleanup (xfree, buffer);
+
memcpy (buffer, writebuf, len);
xfered = ops->deprecated_xfer_memory (offset, buffer, len,
1/*write*/, NULL, ops);
ULONGEST offset, LONGEST len)
{
LONGEST xfered = 0;
+
while (xfered < len)
{
LONGEST xfer = target_read_partial (ops, object, annex,
(gdb_byte *) buf + xfered,
offset + xfered, len - xfered);
+
/* Call an observer, notifying them of the xfer progress? */
if (xfer == 0)
return xfered;
ULONGEST offset, LONGEST len)
{
LONGEST xfered = 0;
+
while (xfered < len)
{
LONGEST xfer = target_read_partial (ops, object, annex,
(gdb_byte *) buf + xfered,
offset + xfered, len - xfered);
+
/* Call an observer, notifying them of the xfer progress? */
if (xfer == 0)
return xfered;
}
ULONGEST
-get_target_memory_unsigned (struct target_ops *ops,
- CORE_ADDR addr, int len, enum bfd_endian byte_order)
+get_target_memory_unsigned (struct target_ops *ops, CORE_ADDR addr,
+ int len, enum bfd_endian byte_order)
{
gdb_byte buf[sizeof (ULONGEST)];
if (t->to_follow_fork != NULL)
{
int retval = t->to_follow_fork (t, follow_child);
+
if (targetdebug)
fprintf_unfiltered (gdb_stdlog, "target_follow_fork (%d) = %d\n",
follow_child, retval);
target_mourn_inferior (void)
{
struct target_ops *t;
+
+ /* Clear schedlock in infrun.c */
+ reset_schedlock ();
+
for (t = current_target.beneath; t != NULL; t = t->beneath)
{
if (t->to_mourn_inferior != NULL)
if (found_ptr != NULL)
{
CORE_ADDR found_addr = start_addr + (found_ptr - search_buf);
+
*found_addrp = found_addr;
do_cleanups (old_cleanups);
return 1;
target_supports_non_stop (void)
{
struct target_ops *t;
+
for (t = ¤t_target; t != NULL; t = t->beneath)
if (t->to_supports_non_stop)
return t->to_supports_non_stop ();
target_attach (char *args, int from_tty)
{
struct target_ops *t;
+
for (t = current_target.beneath; t != NULL; t = t->beneath)
{
if (t->to_attach != NULL)
target_thread_alive (ptid_t ptid)
{
struct target_ops *t;
+
for (t = current_target.beneath; t != NULL; t = t->beneath)
{
if (t->to_thread_alive != NULL)
target_find_new_threads (void)
{
struct target_ops *t;
+
for (t = current_target.beneath; t != NULL; t = t->beneath)
{
if (t->to_find_new_threads != NULL)
struct regcache *regcache, int regno)
{
struct gdbarch *gdbarch = get_regcache_arch (regcache);
+
fprintf_unfiltered (gdb_stdlog, "%s ", func);
if (regno >= 0 && regno < gdbarch_num_regs (gdbarch)
&& gdbarch_register_name (gdbarch, regno) != NULL
enum bfd_endian byte_order = gdbarch_byte_order (gdbarch);
int i, size = register_size (gdbarch, regno);
unsigned char buf[MAX_REGISTER_SIZE];
+
regcache_raw_collect (regcache, regno, buf);
fprintf_unfiltered (gdb_stdlog, " = ");
for (i = 0; i < size; i++)
if (size <= sizeof (LONGEST))
{
ULONGEST val = extract_unsigned_integer (buf, size, byte_order);
+
fprintf_unfiltered (gdb_stdlog, " %s %s",
core_addr_to_string_nz (val), plongest (val));
}
target_fetch_registers (struct regcache *regcache, int regno)
{
struct target_ops *t;
+
for (t = current_target.beneath; t != NULL; t = t->beneath)
{
if (t->to_fetch_registers != NULL)
void
target_store_registers (struct regcache *regcache, int regno)
{
-
struct target_ops *t;
+
for (t = current_target.beneath; t != NULL; t = t->beneath)
{
if (t->to_store_registers != NULL)
if (t->to_core_of_thread != NULL)
{
int retval = t->to_core_of_thread (t, ptid);
+
if (targetdebug)
fprintf_unfiltered (gdb_stdlog, "target_core_of_thread (%d) = %d\n",
PIDGET (ptid), retval);
if (t->to_verify_memory != NULL)
{
int retval = t->to_verify_memory (t, data, memaddr, size);
+
if (targetdebug)
fprintf_unfiltered (gdb_stdlog, "target_verify_memory (%s, %s) = %d\n",
paddress (target_gdbarch, memaddr),
thread_id_to_pid (int num)
{
struct thread_info *thread = find_thread_id (num);
+
if (thread)
return thread->ptid;
else
if (all || ptid_is_pid (ptid))
{
int any_started = 0;
+
for (tp = thread_list; tp; tp = tp->next)
if (all || ptid_get_pid (tp->ptid) == ptid_get_pid (ptid))
{
else
{
int started = 0;
+
tp = find_thread_ptid (ptid);
gdb_assert (tp);
gdb_assert (tp->state_ != THREAD_EXITED);
if (ui_out_is_mi_like_p (uiout))
{
char *state = "stopped";
+
if (tp->state_ == THREAD_RUNNING)
state = "running";
ui_out_field_string (uiout, "state", state);
{
struct current_thread_cleanup *old = arg;
struct thread_info *tp;
+
tp = find_thread_ptid (old->inferior_ptid);
if (tp)
tp->refcount--;
{
#ifdef HAVE_SBRK
char *lim = (char *) sbrk (0);
+
space_at_cmd_start = lim - lim_at_start;
#endif
}
{
#ifdef HAVE_SBRK
char *lim = (char *) sbrk (0);
+
space_at_cmd_start = lim - lim_at_start;
#endif
}
{
#ifdef HAVE_SBRK
char *lim = (char *) sbrk (0);
+
long space_now = lim - lim_at_start;
long space_diff = space_now - space_at_cmd_start;
gdb_rl_operate_and_get_next_completion (void)
{
int delta = where_history () - operate_saved_history;
+
/* The `key' argument to rl_get_previous_history is ignored. */
rl_get_previous_history (delta, 0);
operate_saved_history = -1;
{
collect->aexpr_list =
xrealloc (collect->aexpr_list,
- 2 * collect->aexpr_listsize * sizeof (struct agent_expr *));
+ 2 * collect->aexpr_listsize * sizeof (struct agent_expr *));
collect->aexpr_listsize *= 2;
}
collect->aexpr_list[collect->next_aexpr_elt] = aexpr;
if (ts->stop_reason == tracepoint_error)
{
char *buf = (char *) alloca (strlen (ts->error_desc) * 2 + 1);
+
bin2hex ((gdb_byte *) ts->error_desc, buf, 0);
fprintf (fp, ":%s", buf);
}
int numregs = gdbarch_num_regs (gdbarch) + gdbarch_num_pseudo_regs (gdbarch);
struct trad_frame_saved_reg *this_saved_regs
= FRAME_OBSTACK_CALLOC (numregs, struct trad_frame_saved_reg);
+
for (regnum = 0; regnum < numregs; regnum++)
{
this_saved_regs[regnum].realreg = regnum;
void **this_cache)
{
struct tramp_frame_cache *tramp_cache = (*this_cache);
+
if (tramp_cache->trad_cache == NULL)
{
tramp_cache->trad_cache = trad_frame_cache_zalloc (this_frame);
{
struct trad_frame_cache *trad_cache
= tramp_frame_cache (this_frame, this_cache);
+
trad_frame_get_id (trad_cache, this_id);
}
{
struct trad_frame_cache *trad_cache
= tramp_frame_cache (this_frame, this_cache);
+
return trad_frame_get_register (trad_cache, this_frame, prev_regnum);
}
struct gdbarch *gdbarch = get_frame_arch (this_frame);
enum bfd_endian byte_order = gdbarch_byte_order (gdbarch);
int ti;
+
/* Search through the trampoline for one that matches the
instruction sequence around PC. */
for (ti = 0; tramp->insn[ti].bytes != TRAMP_SENTINEL_INSN; ti++)
{
CORE_ADDR func = pc - tramp->insn_size * ti;
int i;
+
for (i = 0; 1; i++)
{
gdb_byte buf[sizeof (tramp->insn[0])];
ULONGEST insn;
+
if (tramp->insn[i].bytes == TRAMP_SENTINEL_INSN)
return func;
if (!safe_frame_unwind_memory (this_frame,
ui_file_new (void)
{
struct ui_file *file = xmalloc (sizeof (struct ui_file));
+
file->magic = &ui_file_magic;
set_ui_file_data (file, NULL, null_file_delete);
set_ui_file_flush (file, null_file_flush);
is possible to clean up that code. */
int i;
char b[2];
+
b[1] = '\0';
for (i = 0; i < sizeof_buf; i++)
{
do_ui_file_xstrdup (void *context, const char *buffer, long length)
{
struct accumulated_ui_file *acc = context;
+
if (acc->buffer == NULL)
acc->buffer = xmalloc (length + 1);
else
ui_file_xstrdup (struct ui_file *file, long *length)
{
struct accumulated_ui_file acc;
+
acc.buffer = NULL;
acc.length = 0;
ui_file_put (file, do_ui_file_xstrdup, &acc);
do_ui_file_obsavestring (void *context, const char *buffer, long length)
{
struct obstack *obstack = (struct obstack *) context;
+
obstack_grow (obstack, buffer, length);
}
{
struct mem_file *stream = XMALLOC (struct mem_file);
struct ui_file *file = ui_file_new ();
+
set_ui_file_data (file, stream, mem_file_delete);
set_ui_file_rewind (file, mem_file_rewind);
set_ui_file_put (file, mem_file_put);
mem_file_delete (struct ui_file *file)
{
struct mem_file *stream = ui_file_data (file);
+
if (stream->magic != &mem_file_magic)
internal_error (__FILE__, __LINE__,
_("mem_file_delete: bad magic number"));
mem_file_rewind (struct ui_file *file)
{
struct mem_file *stream = ui_file_data (file);
+
if (stream->magic != &mem_file_magic)
internal_error (__FILE__, __LINE__,
_("mem_file_rewind: bad magic number"));
void *dest)
{
struct mem_file *stream = ui_file_data (file);
+
if (stream->magic != &mem_file_magic)
internal_error (__FILE__, __LINE__,
_("mem_file_put: bad magic number"));
long length_buffer)
{
struct mem_file *stream = ui_file_data (file);
+
if (stream->magic != &mem_file_magic)
internal_error (__FILE__, __LINE__,
_("mem_file_write: bad magic number"));
else
{
int new_length = stream->length_buffer + length_buffer;
+
if (new_length >= stream->sizeof_buffer)
{
stream->sizeof_buffer = new_length;
{
struct ui_file *ui_file = ui_file_new ();
struct stdio_file *stdio = xmalloc (sizeof (struct stdio_file));
+
stdio->magic = &stdio_file_magic;
stdio->file = file;
stdio->close_p = close_p;
stdio_file_delete (struct ui_file *file)
{
struct stdio_file *stdio = ui_file_data (file);
+
if (stdio->magic != &stdio_file_magic)
internal_error (__FILE__, __LINE__,
_("stdio_file_delete: bad magic number"));
stdio_file_flush (struct ui_file *file)
{
struct stdio_file *stdio = ui_file_data (file);
+
if (stdio->magic != &stdio_file_magic)
internal_error (__FILE__, __LINE__,
_("stdio_file_flush: bad magic number"));
stdio_file_read (struct ui_file *file, char *buf, long length_buf)
{
struct stdio_file *stdio = ui_file_data (file);
+
if (stdio->magic != &stdio_file_magic)
internal_error (__FILE__, __LINE__,
_("stdio_file_read: bad magic number"));
Control-C can interrupt gdb_select, but not read. */
{
int fd = fileno (stdio->file);
+
fd_set readfds;
FD_ZERO (&readfds);
FD_SET (fd, &readfds);
stdio_file_write (struct ui_file *file, const char *buf, long length_buf)
{
struct stdio_file *stdio = ui_file_data (file);
+
if (stdio->magic != &stdio_file_magic)
internal_error (__FILE__, __LINE__,
_("stdio_file_write: bad magic number"));
stdio_file_fputs (const char *linebuffer, struct ui_file *file)
{
struct stdio_file *stdio = ui_file_data (file);
+
if (stdio->magic != &stdio_file_magic)
internal_error (__FILE__, __LINE__,
_("stdio_file_fputs: bad magic number"));
stdio_file_isatty (struct ui_file *file)
{
struct stdio_file *stdio = ui_file_data (file);
+
if (stdio->magic != &stdio_file_magic)
internal_error (__FILE__, __LINE__,
_("stdio_file_isatty: bad magic number"));
gdb_fopen (char *name, char *mode)
{
FILE *f = fopen (name, mode);
+
if (f == NULL)
return NULL;
return stdio_file_new (f, 1);
{
struct ui_file *ui_file = ui_file_new ();
struct tee_file *tee = xmalloc (sizeof (struct tee_file));
+
tee->magic = &tee_file_magic;
tee->one = one;
tee->two = two;
tee_file_delete (struct ui_file *file)
{
struct tee_file *tee = ui_file_data (file);
+
if (tee->magic != &tee_file_magic)
internal_error (__FILE__, __LINE__,
_("tee_file_delete: bad magic number"));
tee_file_flush (struct ui_file *file)
{
struct tee_file *tee = ui_file_data (file);
+
if (tee->magic != &tee_file_magic)
internal_error (__FILE__, __LINE__,
_("tee_file_flush: bad magic number"));
tee_file_write (struct ui_file *file, const char *buf, long length_buf)
{
struct tee_file *tee = ui_file_data (file);
+
if (tee->magic != &tee_file_magic)
internal_error (__FILE__, __LINE__,
_("tee_file_write: bad magic number"));
tee_file_fputs (const char *linebuffer, struct ui_file *file)
{
struct tee_file *tee = ui_file_data (file);
+
if (tee->magic != &tee_file_magic)
internal_error (__FILE__, __LINE__,
_("tee_file_fputs: bad magic number"));
tee_file_isatty (struct ui_file *file)
{
struct tee_file *tee = ui_file_data (file);
+
if (tee->magic != &tee_file_magic)
internal_error (__FILE__, __LINE__,
_("tee_file_isatty: bad magic number"));
const char *id)
{
struct ui_out_level *current;
+
/* We had better not overflow the buffer. */
uiout->level++;
gdb_assert (uiout->level >= 0 && uiout->level < MAX_UI_OUT_LEVELS);
const char *id)
{
int new_level;
+
if (uiout->table.flag && !uiout->table.body_flag)
internal_error (__FILE__, __LINE__,
_("table header or table_body expected; lists must be \
int fldno;
int width;
int align;
+
verify_field (uiout, &fldno, &width, &align);
}
enum ui_out_type type)
{
int old_level = pop_level (uiout, type);
+
uo_end (uiout, type, old_level);
}
do_cleanup_end (void *data)
{
struct ui_out_end_cleanup_data *end_cleanup_data = data;
+
ui_out_end (end_cleanup_data->uiout, end_cleanup_data->type);
xfree (end_cleanup_data);
}
enum ui_out_type type)
{
struct ui_out_end_cleanup_data *end_cleanup_data;
+
end_cleanup_data = XMALLOC (struct ui_out_end_cleanup_data);
end_cleanup_data->uiout = uiout;
end_cleanup_data->type = type;
long length;
char *buffer = ui_file_xstrdup (buf->stream, &length);
struct cleanup *old_cleanup = make_cleanup (xfree, buffer);
+
if (length > 0)
ui_out_field_string (uiout, fldname, buffer);
else
va_list args;
va_start (args, format);
-
uo_message (uiout, verbosity, format, args);
-
va_end (args);
}
int oldflags = uiout->flags;
uiout->flags |= mask;
-
return oldflags;
}
int oldflags = uiout->flags;
uiout->flags &= ~mask;
-
return oldflags;
}
int flags)
{
struct ui_out *uiout = XMALLOC (struct ui_out);
+
uiout->data = data;
uiout->impl = impl;
uiout->flags = flags;
user_regs_init (struct gdbarch *gdbarch)
{
struct user_reg *reg;
- struct gdb_user_regs *regs = GDBARCH_OBSTACK_ZALLOC (gdbarch, struct gdb_user_regs);
+ struct gdb_user_regs *regs
+ = GDBARCH_OBSTACK_ZALLOC (gdbarch, struct gdb_user_regs);
+
regs->last = ®s->first;
for (reg = builtin_user_regs.first; reg != NULL; reg = reg->next)
append_user_reg (regs, reg->name, reg->read, reg->baton,
user_reg_read_ftype *read, const void *baton)
{
struct gdb_user_regs *regs = gdbarch_data (gdbarch, user_regs_data);
+
if (regs == NULL)
{
/* ULGH, called during architecture initialization. Patch
int i;
int maxregs = (gdbarch_num_regs (gdbarch)
+ gdbarch_num_pseudo_regs (gdbarch));
+
for (i = 0; i < maxregs; i++)
{
const char *regname = gdbarch_register_name (gdbarch, i);
+
if (regname != NULL && len == strlen (regname)
&& strncmp (regname, name, len) == 0)
{
struct gdb_user_regs *regs = gdbarch_data (gdbarch, user_regs_data);
struct user_reg *reg;
int nr;
+
for (nr = 0, reg = regs->first; reg != NULL; reg = reg->next, nr++)
{
if ((len < 0 && strcmp (reg->name, name))
{
struct gdb_user_regs *regs = gdbarch_data (gdbarch, user_regs_data);
struct user_reg *reg;
+
for (reg = regs->first; reg != NULL; reg = reg->next)
{
if (usernum == 0)
{
int maxregs = (gdbarch_num_regs (gdbarch)
+ gdbarch_num_pseudo_regs (gdbarch));
+
if (regnum < 0)
return NULL;
else if (regnum < maxregs)
int maxregs = (gdbarch_num_regs (gdbarch)
+ gdbarch_num_pseudo_regs (gdbarch));
struct user_reg *reg = usernum_to_user_reg (gdbarch, regnum - maxregs);
+
gdb_assert (reg != NULL);
return reg->read (frame, reg->baton);
}
/* Don't allow infinite error/warning recursion. */
{
static char msg[] = "Recursive internal problem.\n";
+
switch (dejavu)
{
case 0:
so that the user knows that they are living on the edge. */
{
char *msg;
+
msg = xstrvprintf (fmt, ap);
reason = xstrprintf ("\
%s:%d: %s: %s\n\
void (*do_fprintf) (struct ui_file *, const char *, ...)
ATTRIBUTE_FPTR_PRINTF_2, struct ui_file *stream, int quoter)
{
-
c &= 0xFF; /* Avoid sign bit follies */
if (c < 0x20 || /* Low control chars */
struct ui_file *stream)
{
int i;
+
for (i = 0; i < n; i++)
printchar (str[i], fputs_unfiltered, fprintf_unfiltered, stream, quoter);
}
if (ignore)
{
char *p = ignore;
+
while (*p == ' ' || *p == '\t')
++p;
if (p[0] == 'q')
about the real size of addr as the above does? */
unsigned long temp[3];
char *str = get_cell ();
-
int i = 0;
+
do
{
temp[i] = addr % (1000 * 1000 * 1000);
{
unsigned long temp[3];
char *str = get_cell ();
-
int i = 0;
+
do
{
temp[i] = addr % (0100000 * 0100000);
case 8:
{
unsigned long high = (unsigned long) (l >> thirty_two);
+
str = get_cell ();
if (high == 0)
xsnprintf (str, CELLSIZE, "%lx",
case 16:
{
char *result;
+
if (width == 0)
result = hex_string (val);
else
case 8:
{
char *result = octal2str (val, width);
+
if (use_c_format || val == 0)
return result;
else
{
/* Assume that it is in hex. */
int i;
+
for (i = 2; my_string[i] != '\0'; i++)
{
if (isdigit (my_string[i]))
{
/* Assume that it is in decimal. */
int i;
+
for (i = 0; my_string[i] != '\0'; i++)
{
if (isdigit (my_string[i]))
# endif
# if defined (USE_REALPATH)
const char *rp = realpath (filename, buf);
+
if (rp == NULL)
rp = filename;
return xstrdup (rp);
#if defined(HAVE_CANONICALIZE_FILE_NAME)
{
char *rp = canonicalize_file_name (filename);
+
if (rp == NULL)
return xstrdup (filename);
else
{
/* Find out the max path size. */
long path_max = pathconf ("/", _PC_PATH_MAX);
+
if (path_max > 0)
{
/* PATH_MAX is bounded. */
char *buf = alloca (path_max);
char *rp = realpath (filename, buf);
+
return xstrdup (rp ? rp : filename);
}
}