This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
- the Free Software Foundation; either version 2 of the License, or
+ the Free Software Foundation; either version 3 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
- along with this program; if not, write to the Free Software
- Foundation, Inc., 51 Franklin Street, Fifth Floor,
- Boston, MA 02110-1301, USA. */
+ along with this program. If not, see <http://www.gnu.org/licenses/>. */
#include "defs.h"
#include "gdb_assert.h"
static struct cleanup *cleanup_chain; /* cleaned up after a failed command */
static struct cleanup *final_cleanup_chain; /* cleaned up when gdb exits */
-static struct cleanup *run_cleanup_chain; /* cleaned up on each 'run' */
static struct cleanup *exec_cleanup_chain; /* cleaned up on each execution command */
/* cleaned up on each error from within an execution command */
static struct cleanup *exec_error_cleanup_chain;
return make_my_cleanup (&final_cleanup_chain, function, arg);
}
-struct cleanup *
-make_run_cleanup (make_cleanup_ftype *function, void *arg)
-{
- return make_my_cleanup (&run_cleanup_chain, function, arg);
-}
-
struct cleanup *
make_exec_cleanup (make_cleanup_ftype *function, void *arg)
{
do_my_cleanups (&final_cleanup_chain, old_chain);
}
-void
-do_run_cleanups (struct cleanup *old_chain)
-{
- do_my_cleanups (&run_cleanup_chain, old_chain);
-}
-
void
do_exec_cleanups (struct cleanup *old_chain)
{
rows = INT_MAX;
if (cols <= 0)
- rl_get_screen_size (NULL, &cols);
+ cols = INT_MAX;
/* Update Readline's idea of the terminal size. */
rl_set_screen_size (rows, cols);
int
strlen_paddr (void)
{
- return (TARGET_ADDR_BIT / 8 * 2);
+ return (gdbarch_addr_bit (current_gdbarch) / 8 * 2);
}
char *
paddr (CORE_ADDR addr)
{
- return phex (addr, TARGET_ADDR_BIT / 8);
+ return phex (addr, gdbarch_addr_bit (current_gdbarch) / 8);
}
char *
paddr_nz (CORE_ADDR addr)
{
- return phex_nz (addr, TARGET_ADDR_BIT / 8);
+ return phex_nz (addr, gdbarch_addr_bit (current_gdbarch) / 8);
}
const char *
when it won't occur. */
/* NOTE: This assumes that the significant address information is
kept in the least significant bits of ADDR - the upper bits were
- either zero or sign extended. Should ADDRESS_TO_POINTER() or
+ either zero or sign extended. Should gdbarch_address_to_pointer or
some ADDRESS_TO_PRINTABLE() be used to do the conversion? */
- int addr_bit = TARGET_ADDR_BIT;
+ int addr_bit = gdbarch_addr_bit (current_gdbarch);
if (addr_bit < (sizeof (CORE_ADDR) * HOST_CHAR_BIT))
addr &= ((CORE_ADDR) 1 << addr_bit) - 1;