* defs.h (plongest,pulongest): Renamed from paddr_u,paddr_d.
authorDoug Evans <dje@google.com>
Thu, 4 Sep 2008 22:49:30 +0000 (22:49 +0000)
committerDoug Evans <dje@google.com>
Thu, 4 Sep 2008 22:49:30 +0000 (22:49 +0000)
Change argument of pulongest from CORE_ADDR to ULONGEST.
All callers updated.
* utils.c (plongest): Renamed from paddr_d.
(pulongest): Renamed from paddr_u, change arg type to ULONGEST.
* remote-mips.c (send_srec): Use paddr_nz instead of paddr_u in
`CORE_ADDR addr' arg of error message.

gdb/ChangeLog
gdb/auxv.c
gdb/defs.h
gdb/gcore.c
gdb/gdbarch.c
gdb/gdbarch.sh
gdb/ia64-tdep.c
gdb/maint.c
gdb/remote-mips.c
gdb/target.c
gdb/utils.c

index e9f8b83c2828ffef43620b6857a651575c2e6ec5..ab6b1c74a47f1536366cd4f145ffb7a55e8ceeb1 100644 (file)
@@ -1,3 +1,13 @@
+2008-09-04  Doug Evans  <dje@google.com>
+
+       * defs.h (plongest,pulongest): Renamed from paddr_u,paddr_d.
+       Change argument of pulongest from CORE_ADDR to ULONGEST.
+       All callers updated.
+       * utils.c (plongest): Renamed from paddr_d.
+       (pulongest): Renamed from paddr_u, change arg type to ULONGEST.
+       * remote-mips.c (send_srec): Use paddr_nz instead of paddr_u in
+       `CORE_ADDR addr' arg of error message.
+
 2008-09-03  Angela Marie Thomas <angela@releasedominatrix.com>
 
        * ser-tcp.c (ser_tcp_send_break): New function.
index 549b666cb3cf814d936e0344d9cf55e48c03704e..0baec1a7bf77a67d4e2b4354ceee534679fd9e83 100644 (file)
@@ -229,11 +229,11 @@ fprint_target_auxv (struct ui_file *file, struct target_ops *ops)
        }
 
       fprintf_filtered (file, "%-4s %-20s %-30s ",
-                       paddr_d (type), name, description);
+                       plongest (type), name, description);
       switch (flavor)
        {
        case dec:
-         fprintf_filtered (file, "%s\n", paddr_d (val));
+         fprintf_filtered (file, "%s\n", plongest (val));
          break;
        case hex:
          fprintf_filtered (file, "0x%s\n", paddr_nz (val));
index 0521ec7c9d70c0db162046a3faef4f0066ca3f44..e5990c7c88072c23aa1a920f112733509274cabc 100644 (file)
@@ -489,17 +489,19 @@ extern void gdb_print_host_address (const void *addr, struct ui_file *stream);
 extern const char *host_address_to_string (const void *addr);
 
 /* Convert a CORE_ADDR into a HEX string.  paddr() is like %08lx.
-   paddr_nz() is like %lx.  paddr_u() is like %lu. paddr_width() is
-   for ``%*''. */
+   paddr_nz() is like %lx.  */
 extern int strlen_paddr (void);
 extern char *paddr (CORE_ADDR addr);
 extern char *paddr_nz (CORE_ADDR addr);
-extern char *paddr_u (CORE_ADDR addr);
-extern char *paddr_d (LONGEST addr);
 
 /* Like 0x%lx.  */
 extern const char *paddress (CORE_ADDR addr);
 
+/* %d for LONGEST */
+extern char *plongest (LONGEST l);
+/* %u for ULONGEST */
+extern char *pulongest (ULONGEST l);
+
 extern char *phex (ULONGEST l, int sizeof_l);
 extern char *phex_nz (ULONGEST l, int sizeof_l);
 extern char *int_string (LONGEST, int, int, int, int);
index 7c69e4bee4afef80777c55a41491346969b65916..2784a5e03daad965197ce54986b0b1be8f64aa2f 100644 (file)
@@ -325,7 +325,7 @@ gcore_create_callback (CORE_ADDR vaddr, unsigned long size,
       if (info_verbose)
         {
           fprintf_filtered (gdb_stdout, "Ignore segment, %s bytes at 0x%s\n",
-                           paddr_d (size), paddr_nz (vaddr));
+                            plongest (size), paddr_nz (vaddr));
         }
 
       return 0;
@@ -383,7 +383,7 @@ gcore_create_callback (CORE_ADDR vaddr, unsigned long size,
   if (info_verbose)
     {
       fprintf_filtered (gdb_stdout, "Save segment, %s bytes at 0x%s\n",
-                       paddr_d (size), paddr_nz (vaddr));
+                       plongest (size), paddr_nz (vaddr));
     }
 
   bfd_set_section_size (obfd, osec, size);
@@ -476,7 +476,7 @@ gcore_copy_callback (bfd *obfd, asection *osec, void *ignored)
                              memhunk, size) != 0)
        {
          warning (_("Memory read failed for corefile section, %s bytes at 0x%s."),
-                  paddr_d (size), paddr (bfd_section_vma (obfd, osec)));
+                  plongest (size), paddr (bfd_section_vma (obfd, osec)));
          break;
        }
       if (!bfd_set_section_contents (obfd, osec, memhunk, offset, size))
index aa5063e1102113ea9d00b5e32b0ede2dfddc5a72..c41d1ce3f21b3674397e0eb86e7f6adb45500ffe 100644 (file)
@@ -651,7 +651,7 @@ gdbarch_dump (struct gdbarch *gdbarch, struct ui_file *file)
                       gdb_nm_file);
   fprintf_unfiltered (file,
                       "gdbarch_dump: addr_bit = %s\n",
-                      paddr_d (gdbarch->addr_bit));
+                      plongest (gdbarch->addr_bit));
   fprintf_unfiltered (file,
                       "gdbarch_dump: addr_bits_remove = <0x%lx>\n",
                       (long) gdbarch->addr_bits_remove);
@@ -684,37 +684,37 @@ gdbarch_dump (struct gdbarch *gdbarch, struct ui_file *file)
                       (long) gdbarch->adjust_breakpoint_address);
   fprintf_unfiltered (file,
                       "gdbarch_dump: believe_pcc_promotion = %s\n",
-                      paddr_d (gdbarch->believe_pcc_promotion));
+                      plongest (gdbarch->believe_pcc_promotion));
   fprintf_unfiltered (file,
                       "gdbarch_dump: bfd_arch_info = %s\n",
                       gdbarch_bfd_arch_info (gdbarch)->printable_name);
   fprintf_unfiltered (file,
                       "gdbarch_dump: bits_big_endian = %s\n",
-                      paddr_d (gdbarch->bits_big_endian));
+                      plongest (gdbarch->bits_big_endian));
   fprintf_unfiltered (file,
                       "gdbarch_dump: breakpoint_from_pc = <0x%lx>\n",
                       (long) gdbarch->breakpoint_from_pc);
   fprintf_unfiltered (file,
                       "gdbarch_dump: byte_order = %s\n",
-                      paddr_d (gdbarch->byte_order));
+                      plongest (gdbarch->byte_order));
   fprintf_unfiltered (file,
                       "gdbarch_dump: byte_order_for_code = %s\n",
-                      paddr_d (gdbarch->byte_order_for_code));
+                      plongest (gdbarch->byte_order_for_code));
   fprintf_unfiltered (file,
                       "gdbarch_dump: call_dummy_location = %s\n",
-                      paddr_d (gdbarch->call_dummy_location));
+                      plongest (gdbarch->call_dummy_location));
   fprintf_unfiltered (file,
                       "gdbarch_dump: cannot_fetch_register = <0x%lx>\n",
                       (long) gdbarch->cannot_fetch_register);
   fprintf_unfiltered (file,
                       "gdbarch_dump: cannot_step_breakpoint = %s\n",
-                      paddr_d (gdbarch->cannot_step_breakpoint));
+                      plongest (gdbarch->cannot_step_breakpoint));
   fprintf_unfiltered (file,
                       "gdbarch_dump: cannot_store_register = <0x%lx>\n",
                       (long) gdbarch->cannot_store_register);
   fprintf_unfiltered (file,
                       "gdbarch_dump: char_signed = %s\n",
-                      paddr_d (gdbarch->char_signed));
+                      plongest (gdbarch->char_signed));
   fprintf_unfiltered (file,
                       "gdbarch_dump: coff_make_msymbol_special = <0x%lx>\n",
                       (long) gdbarch->coff_make_msymbol_special);
@@ -747,7 +747,7 @@ gdbarch_dump (struct gdbarch *gdbarch, struct ui_file *file)
                       paddr_nz (gdbarch->decr_pc_after_break));
   fprintf_unfiltered (file,
                       "gdbarch_dump: deprecated_fp_regnum = %s\n",
-                      paddr_d (gdbarch->deprecated_fp_regnum));
+                      plongest (gdbarch->deprecated_fp_regnum));
   fprintf_unfiltered (file,
                       "gdbarch_dump: deprecated_function_start_offset = 0x%s\n",
                       paddr_nz (gdbarch->deprecated_function_start_offset));
@@ -771,7 +771,7 @@ gdbarch_dump (struct gdbarch *gdbarch, struct ui_file *file)
                       (long) gdbarch->displaced_step_location);
   fprintf_unfiltered (file,
                       "gdbarch_dump: double_bit = %s\n",
-                      paddr_d (gdbarch->double_bit));
+                      plongest (gdbarch->double_bit));
   fprintf_unfiltered (file,
                       "gdbarch_dump: double_format = %s\n",
                       pformat (gdbarch->double_format));
@@ -804,13 +804,13 @@ gdbarch_dump (struct gdbarch *gdbarch, struct ui_file *file)
                       (long) gdbarch->fetch_tls_load_module_address);
   fprintf_unfiltered (file,
                       "gdbarch_dump: float_bit = %s\n",
-                      paddr_d (gdbarch->float_bit));
+                      plongest (gdbarch->float_bit));
   fprintf_unfiltered (file,
                       "gdbarch_dump: float_format = %s\n",
                       pformat (gdbarch->float_format));
   fprintf_unfiltered (file,
                       "gdbarch_dump: fp0_regnum = %s\n",
-                      paddr_d (gdbarch->fp0_regnum));
+                      plongest (gdbarch->fp0_regnum));
   fprintf_unfiltered (file,
                       "gdbarch_dump: gdbarch_frame_align_p() = %d\n",
                       gdbarch_frame_align_p (gdbarch));
@@ -828,7 +828,7 @@ gdbarch_dump (struct gdbarch *gdbarch, struct ui_file *file)
                       (long) gdbarch->frame_num_args);
   fprintf_unfiltered (file,
                       "gdbarch_dump: frame_red_zone_size = %s\n",
-                      paddr_d (gdbarch->frame_red_zone_size));
+                      plongest (gdbarch->frame_red_zone_size));
   fprintf_unfiltered (file,
                       "gdbarch_dump: gdbarch_get_longjmp_target_p() = %d\n",
                       gdbarch_get_longjmp_target_p (gdbarch));
@@ -837,7 +837,7 @@ gdbarch_dump (struct gdbarch *gdbarch, struct ui_file *file)
                       (long) gdbarch->get_longjmp_target);
   fprintf_unfiltered (file,
                       "gdbarch_dump: have_nonsteppable_watchpoint = %s\n",
-                      paddr_d (gdbarch->have_nonsteppable_watchpoint));
+                      plongest (gdbarch->have_nonsteppable_watchpoint));
   fprintf_unfiltered (file,
                       "gdbarch_dump: in_function_epilogue_p = <0x%lx>\n",
                       (long) gdbarch->in_function_epilogue_p);
@@ -849,7 +849,7 @@ gdbarch_dump (struct gdbarch *gdbarch, struct ui_file *file)
                       (long) gdbarch->inner_than);
   fprintf_unfiltered (file,
                       "gdbarch_dump: int_bit = %s\n",
-                      paddr_d (gdbarch->int_bit));
+                      plongest (gdbarch->int_bit));
   fprintf_unfiltered (file,
                       "gdbarch_dump: gdbarch_integer_to_address_p() = %d\n",
                       gdbarch_integer_to_address_p (gdbarch));
@@ -858,22 +858,22 @@ gdbarch_dump (struct gdbarch *gdbarch, struct ui_file *file)
                       (long) gdbarch->integer_to_address);
   fprintf_unfiltered (file,
                       "gdbarch_dump: long_bit = %s\n",
-                      paddr_d (gdbarch->long_bit));
+                      plongest (gdbarch->long_bit));
   fprintf_unfiltered (file,
                       "gdbarch_dump: long_double_bit = %s\n",
-                      paddr_d (gdbarch->long_double_bit));
+                      plongest (gdbarch->long_double_bit));
   fprintf_unfiltered (file,
                       "gdbarch_dump: long_double_format = %s\n",
                       pformat (gdbarch->long_double_format));
   fprintf_unfiltered (file,
                       "gdbarch_dump: long_long_bit = %s\n",
-                      paddr_d (gdbarch->long_long_bit));
+                      plongest (gdbarch->long_long_bit));
   fprintf_unfiltered (file,
                       "gdbarch_dump: gdbarch_max_insn_length_p() = %d\n",
                       gdbarch_max_insn_length_p (gdbarch));
   fprintf_unfiltered (file,
                       "gdbarch_dump: max_insn_length = %s\n",
-                      paddr_d (gdbarch->max_insn_length));
+                      plongest (gdbarch->max_insn_length));
   fprintf_unfiltered (file,
                       "gdbarch_dump: memory_insert_breakpoint = <0x%lx>\n",
                       (long) gdbarch->memory_insert_breakpoint);
@@ -885,13 +885,13 @@ gdbarch_dump (struct gdbarch *gdbarch, struct ui_file *file)
                       gdbarch->name_of_malloc);
   fprintf_unfiltered (file,
                       "gdbarch_dump: num_pseudo_regs = %s\n",
-                      paddr_d (gdbarch->num_pseudo_regs));
+                      plongest (gdbarch->num_pseudo_regs));
   fprintf_unfiltered (file,
                       "gdbarch_dump: num_regs = %s\n",
-                      paddr_d (gdbarch->num_regs));
+                      plongest (gdbarch->num_regs));
   fprintf_unfiltered (file,
                       "gdbarch_dump: osabi = %s\n",
-                      paddr_d (gdbarch->osabi));
+                      plongest (gdbarch->osabi));
   fprintf_unfiltered (file,
                       "gdbarch_dump: gdbarch_overlay_update_p() = %d\n",
                       gdbarch_overlay_update_p (gdbarch));
@@ -900,7 +900,7 @@ gdbarch_dump (struct gdbarch *gdbarch, struct ui_file *file)
                       (long) gdbarch->overlay_update);
   fprintf_unfiltered (file,
                       "gdbarch_dump: pc_regnum = %s\n",
-                      paddr_d (gdbarch->pc_regnum));
+                      plongest (gdbarch->pc_regnum));
   fprintf_unfiltered (file,
                       "gdbarch_dump: pointer_to_address = <0x%lx>\n",
                       (long) gdbarch->pointer_to_address);
@@ -924,7 +924,7 @@ gdbarch_dump (struct gdbarch *gdbarch, struct ui_file *file)
                       (long) gdbarch->print_vector_info);
   fprintf_unfiltered (file,
                       "gdbarch_dump: ps_regnum = %s\n",
-                      paddr_d (gdbarch->ps_regnum));
+                      plongest (gdbarch->ps_regnum));
   fprintf_unfiltered (file,
                       "gdbarch_dump: gdbarch_pseudo_register_read_p() = %d\n",
                       gdbarch_pseudo_register_read_p (gdbarch));
@@ -939,7 +939,7 @@ gdbarch_dump (struct gdbarch *gdbarch, struct ui_file *file)
                       (long) gdbarch->pseudo_register_write);
   fprintf_unfiltered (file,
                       "gdbarch_dump: ptr_bit = %s\n",
-                      paddr_d (gdbarch->ptr_bit));
+                      plongest (gdbarch->ptr_bit));
   fprintf_unfiltered (file,
                       "gdbarch_dump: gdbarch_push_dummy_call_p() = %d\n",
                       gdbarch_push_dummy_call_p (gdbarch));
@@ -1002,7 +1002,7 @@ gdbarch_dump (struct gdbarch *gdbarch, struct ui_file *file)
                       (long) gdbarch->sdb_reg_to_regnum);
   fprintf_unfiltered (file,
                       "gdbarch_dump: short_bit = %s\n",
-                      paddr_d (gdbarch->short_bit));
+                      plongest (gdbarch->short_bit));
   fprintf_unfiltered (file,
                       "gdbarch_dump: gdbarch_single_step_through_delay_p() = %d\n",
                       gdbarch_single_step_through_delay_p (gdbarch));
@@ -1041,10 +1041,10 @@ gdbarch_dump (struct gdbarch *gdbarch, struct ui_file *file)
                       (long) gdbarch->software_single_step);
   fprintf_unfiltered (file,
                       "gdbarch_dump: sofun_address_maybe_missing = %s\n",
-                      paddr_d (gdbarch->sofun_address_maybe_missing));
+                      plongest (gdbarch->sofun_address_maybe_missing));
   fprintf_unfiltered (file,
                       "gdbarch_dump: sp_regnum = %s\n",
-                      paddr_d (gdbarch->sp_regnum));
+                      plongest (gdbarch->sp_regnum));
   fprintf_unfiltered (file,
                       "gdbarch_dump: stab_reg_to_regnum = <0x%lx>\n",
                       (long) gdbarch->stab_reg_to_regnum);
@@ -1059,7 +1059,7 @@ gdbarch_dump (struct gdbarch *gdbarch, struct ui_file *file)
                       (long) gdbarch->static_transform_name);
   fprintf_unfiltered (file,
                       "gdbarch_dump: target_desc = %s\n",
-                      paddr_d ((long) gdbarch->target_desc));
+                      plongest ((long) gdbarch->target_desc));
   fprintf_unfiltered (file,
                       "gdbarch_dump: target_signal_from_host = <0x%lx>\n",
                       (long) gdbarch->target_signal_from_host);
@@ -1086,13 +1086,13 @@ gdbarch_dump (struct gdbarch *gdbarch, struct ui_file *file)
                       (long) gdbarch->value_to_register);
   fprintf_unfiltered (file,
                       "gdbarch_dump: vbit_in_delta = %s\n",
-                      paddr_d (gdbarch->vbit_in_delta));
+                      plongest (gdbarch->vbit_in_delta));
   fprintf_unfiltered (file,
                       "gdbarch_dump: virtual_frame_pointer = <0x%lx>\n",
                       (long) gdbarch->virtual_frame_pointer);
   fprintf_unfiltered (file,
                       "gdbarch_dump: vtable_function_descriptors = %s\n",
-                      paddr_d (gdbarch->vtable_function_descriptors));
+                      plongest (gdbarch->vtable_function_descriptors));
   fprintf_unfiltered (file,
                       "gdbarch_dump: gdbarch_write_pc_p() = %d\n",
                       gdbarch_write_pc_p (gdbarch));
index 156311e89b10827fda74358e239a5ea2f85816b6..82f68f03dc53144b7c02f2eaeb0718933a1cbceb 100755 (executable)
@@ -318,7 +318,7 @@ do
        # An optional expression that convers MEMBER to a value
        # suitable for formatting using %s.
 
-       # If PRINT is empty, paddr_nz (for CORE_ADDR) or paddr_d
+       # If PRINT is empty, paddr_nz (for CORE_ADDR) or plongest
        # (anything else) is used.
 
     garbage_at_eol ) : ;;
@@ -343,7 +343,7 @@ i:int:byte_order_for_code:::BFD_ENDIAN_BIG
 #
 i:enum gdb_osabi:osabi:::GDB_OSABI_UNKNOWN
 #
-i:const struct target_desc *:target_desc:::::::paddr_d ((long) gdbarch->target_desc)
+i:const struct target_desc *:target_desc:::::::plongest ((long) gdbarch->target_desc)
 
 # The bit byte-order has to do just with numbering of bits in debugging symbols
 # and such.  Conceptually, it's quite separate from byte/word byte order.
@@ -1479,7 +1479,7 @@ do
                ;;
            :* )
                fmt="%s"
-               print="paddr_d (gdbarch->${function})"
+               print="plongest (gdbarch->${function})"
                ;;
            * )
                fmt="%s"
index 1302741f51bcffabbd8bd72fa3ad332d174d31e3..df5f43adc3e2ce9321a94201e72cafc57b670f80 100644 (file)
@@ -2396,7 +2396,7 @@ get_kernel_table (unw_word_t ip, unw_dyn_info_t *di)
                        "segbase=0x%s, length=%s, gp=0x%s\n",
                        (char *) di->u.ti.name_ptr, 
                        paddr_nz (di->u.ti.segbase), 
-                       paddr_u (di->u.ti.table_len), 
+                       pulongest (di->u.ti.table_len), 
                        paddr_nz (di->gp));
   return 0;
 }
@@ -2505,7 +2505,7 @@ ia64_find_proc_info_x (unw_addr_space_t as, unw_word_t ip, unw_proc_info_t *pi,
                            paddr_nz (di.u.ti.segbase), 
                            paddr_nz (di.start_ip), paddr_nz (di.end_ip),
                            paddr_nz (di.gp), 
-                           paddr_u (di.u.ti.table_len), 
+                           pulongest (di.u.ti.table_len), 
                            paddr_nz ((CORE_ADDR)di.u.ti.table_data));
     }
   else
@@ -2522,7 +2522,7 @@ ia64_find_proc_info_x (unw_addr_space_t as, unw_word_t ip, unw_proc_info_t *pi,
                            paddr_nz (di.u.rti.segbase), 
                            paddr_nz (di.start_ip), paddr_nz (di.end_ip),
                            paddr_nz (di.gp), 
-                           paddr_u (di.u.rti.table_len), 
+                           pulongest (di.u.rti.table_len), 
                            paddr_nz (di.u.rti.table_data));
     }
 
index 3190bd767f08134e0eec3de905ec63429565a9d6..b223f25801b2f8d7cf80fe38e2def80336a8db44 100644 (file)
@@ -485,7 +485,7 @@ maintenance_translate_address (char *arg, int from_tty)
   if (sym)
     printf_filtered ("%s+%s\n",
                     SYMBOL_PRINT_NAME (sym),
-                    paddr_u (address - SYMBOL_VALUE_ADDRESS (sym)));
+                    pulongest (address - SYMBOL_VALUE_ADDRESS (sym)));
   else if (sect)
     printf_filtered (_("no symbol at %s:0x%s\n"), sect->name, paddr (address));
   else
index 9b8ca0bf24f10772eca6598fbb76fe6815bd484d..bde8614a7b9a8fcc84ae1ba6625f3f7f56ac2c2f 100644 (file)
@@ -2620,7 +2620,7 @@ send_srec (char *srec, int len, CORE_ADDR addr)
        case 0x6:               /* ACK */
          return;
        case 0x15:              /* NACK */
-         fprintf_unfiltered (gdb_stderr, "Download got a NACK at byte %s!  Retrying.\n", paddr_u (addr));
+         fprintf_unfiltered (gdb_stderr, "Download got a NACK at byte 0x%s!  Retrying.\n", paddr_nz (addr));
          continue;
        default:
          error ("Download got unexpected ack char: 0x%x, retrying.\n", ch);
index edd804dc50bb0aa04d561a8f37e51aa2b896d371..9dd8f3e5307be2fda8e9b14d5fe4c6a1f932d635 100644 (file)
@@ -1173,7 +1173,7 @@ target_xfer_partial (struct target_ops *ops,
                          (int) object,
                          (annex ? annex : "(null)"),
                          (long) readbuf, (long) writebuf,
-                         paddr_nz (offset), paddr_d (len), paddr_d (retval));
+                         paddr_nz (offset), plongest (len), plongest (retval));
 
       if (readbuf)
        myaddr = readbuf;
@@ -2566,7 +2566,7 @@ debug_print_register (const char * func,
        {
          ULONGEST val = extract_unsigned_integer (buf, size);
          fprintf_unfiltered (gdb_stdlog, " 0x%s %s",
-                             paddr_nz (val), paddr_d (val));
+                             paddr_nz (val), plongest (val));
        }
     }
   fprintf_unfiltered (gdb_stdlog, "\n");
index c787dd044d38ca73d48088617dbed372bcb78b6b..4aa336765047eb1eaf79a535e2819f247e24ed2e 100644 (file)
@@ -2676,18 +2676,18 @@ octal2str (ULONGEST addr, int width)
 }
 
 char *
-paddr_u (CORE_ADDR addr)
+pulongest (ULONGEST u)
 {
-  return decimal2str ("", addr, 0);
+  return decimal2str ("", u, 0);
 }
 
 char *
-paddr_d (LONGEST addr)
+plongest (LONGEST l)
 {
-  if (addr < 0)
-    return decimal2str ("-", -addr, 0);
+  if (l < 0)
+    return decimal2str ("-", -l, 0);
   else
-    return decimal2str ("", addr, 0);
+    return decimal2str ("", l, 0);
 }
 
 /* Eliminate warning from compiler on 32-bit systems.  */