projects
/
deliverable
/
binutils-gdb.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
* vaxnbsd-tdep.c: New file.
[deliverable/binutils-gdb.git]
/
gdb
/
v850ice.c
diff --git
a/gdb/v850ice.c
b/gdb/v850ice.c
index 58fc820db3bc691492bca3eece183dcff64f4604..9f516a32d91e2a2d8fe1648ce72fb0d0ee324fea 100644
(file)
--- a/
gdb/v850ice.c
+++ b/
gdb/v850ice.c
@@
-1,5
+1,6
@@
/* ICE interface for the NEC V850 for GDB, the GNU debugger.
/* ICE interface for the NEC V850 for GDB, the GNU debugger.
- Copyright 1996, 2000 Free Software Foundation, Inc.
+ Copyright 1996, 1997, 1998, 1999, 2000, 2001
+ Free Software Foundation, Inc.
This file is part of GDB.
This file is part of GDB.
@@
-30,6
+31,7
@@
#include "gdbcore.h"
#include "value.h"
#include "command.h"
#include "gdbcore.h"
#include "value.h"
#include "command.h"
+#include "regcache.h"
#include <tcl.h>
#include <windows.h>
#include <tcl.h>
#include <windows.h>
@@
-48,12
+50,6
@@
struct MessageIO
/* Prototypes for functions located in other files */
extern void break_command (char *, int);
/* Prototypes for functions located in other files */
extern void break_command (char *, int);
-extern void stepi_command (char *, int);
-
-extern void nexti_command (char *, int);
-
-extern void continue_command (char *, int);
-
extern int (*ui_loop_hook) (int);
/* Prototypes for local functions */
extern int (*ui_loop_hook) (int);
/* Prototypes for local functions */
@@
-71,7
+67,8
@@
static void v850ice_prepare_to_store (void);
static void v850ice_fetch_registers (int regno);
static void v850ice_fetch_registers (int regno);
-static void v850ice_resume (int pid, int step, enum target_signal siggnal);
+static void v850ice_resume (ptid_t ptid, int step,
+ enum target_signal siggnal);
static void v850ice_open (char *name, int from_tty);
static void v850ice_open (char *name, int from_tty);
@@
-83,7
+80,8
@@
static void v850ice_store_registers (int regno);
static void v850ice_mourn (void);
static void v850ice_mourn (void);
-static int v850ice_wait (int pid, struct target_waitstatus *status);
+static ptid_t v850ice_wait (ptid_t ptid,
+ struct target_waitstatus *status);
static void v850ice_kill (void);
static void v850ice_kill (void);
@@
-192,7
+190,7
@@
static struct target_ops v850ice_ops; /* Forward decl */
/* This function creates a hidden window */
static int
/* This function creates a hidden window */
static int
-init_hidden_window ()
+init_hidden_window (
void
)
{
WNDCLASS class;
{
WNDCLASS class;
@@
-242,11
+240,7
@@
init_hidden_window ()
WM_STATE_CHANGE - tells us that a state change has occured in the ICE
*/
static LRESULT CALLBACK
WM_STATE_CHANGE - tells us that a state change has occured in the ICE
*/
static LRESULT CALLBACK
-v850ice_wndproc (hwnd, message, wParam, lParam)
- HWND hwnd;
- UINT message;
- WPARAM wParam;
- LPARAM lParam;
+v850ice_wndproc (HWND hwnd, UINT message, WPARAM wParam, LPARAM lParam)
{
LRESULT result = FALSE;
{
LRESULT result = FALSE;
@@
-295,13
+289,13
@@
v850ice_wndproc (hwnd, message, wParam, lParam)
result = TRUE;
break;
case STATE_CHANGE_STEPI:
result = TRUE;
break;
case STATE_CHANGE_STEPI:
- if (!catch_errors ((catch_errors_ftype *) ice_stepi, (
PTR) (
int) lParam, "",
+ if (!catch_errors ((catch_errors_ftype *) ice_stepi, (int) lParam, "",
RETURN_MASK_ALL))
printf_unfiltered ("stepi errored\n");
result = TRUE;
break;
case STATE_CHANGE_NEXTI:
RETURN_MASK_ALL))
printf_unfiltered ("stepi errored\n");
result = TRUE;
break;
case STATE_CHANGE_NEXTI:
- if (!catch_errors ((catch_errors_ftype *) ice_nexti, (
PTR) (
int) lParam, "",
+ if (!catch_errors ((catch_errors_ftype *) ice_nexti, (int) lParam, "",
RETURN_MASK_ALL))
printf_unfiltered ("nexti errored\n");
result = TRUE;
RETURN_MASK_ALL))
printf_unfiltered ("nexti errored\n");
result = TRUE;
@@
-318,9
+312,7
@@
v850ice_wndproc (hwnd, message, wParam, lParam)
/* Code for opening a connection to the ICE. */
static void
/* Code for opening a connection to the ICE. */
static void
-v850ice_open (name, from_tty)
- char *name;
- int from_tty;
+v850ice_open (char *name, int from_tty)
{
HINSTANCE handle;
{
HINSTANCE handle;
@@
-371,7
+363,7
@@
v850ice_open (name, from_tty)
target is active. These functions should be split out into seperate
variables, especially since GDB will someday have a notion of debugging
several processes. */
target is active. These functions should be split out into seperate
variables, especially since GDB will someday have a notion of debugging
several processes. */
- inferior_p
id = 42000
;
+ inferior_p
tid = pid_to_ptid (42000)
;
start_remote ();
return;
start_remote ();
return;
@@
-379,31
+371,27
@@
v850ice_open (name, from_tty)
/* Clean up connection to a remote debugger. */
/* Clean up connection to a remote debugger. */
-/* ARGSUSED */
static void
static void
-v850ice_close (quitting)
- int quitting;
+v850ice_close (int quitting)
{
if (ice_open)
{
UnregisterClient ();
ice_open = 0;
{
if (ice_open)
{
UnregisterClient ();
ice_open = 0;
- inferior_p
id = 0
;
+ inferior_p
tid = null_ptid
;
}
}
/* Stop the process on the ice. */
static void
}
}
/* Stop the process on the ice. */
static void
-v850ice_stop ()
+v850ice_stop (
void
)
{
/* This is silly, but it works... */
v850ice_command ("stop", 0);
}
static void
{
/* This is silly, but it works... */
v850ice_command ("stop", 0);
}
static void
-v850ice_detach (args, from_tty)
- char *args;
- int from_tty;
+v850ice_detach (char *args, int from_tty)
{
if (args)
error ("Argument given to \"detach\" when remotely debugging.");
{
if (args)
error ("Argument given to \"detach\" when remotely debugging.");
@@
-416,9
+404,7
@@
v850ice_detach (args, from_tty)
/* Tell the remote machine to resume. */
static void
/* Tell the remote machine to resume. */
static void
-v850ice_resume (pid, step, siggnal)
- int pid, step;
- enum target_signal siggnal;
+v850ice_resume (ptid_t ptid, int step, enum target_signal siggnal)
{
long retval;
char buf[256];
{
long retval;
char buf[256];
@@
-441,10
+427,8
@@
v850ice_resume (pid, step, siggnal)
Returns "pid" (though it's not clear what, if anything, that
means in the case of this target). */
Returns "pid" (though it's not clear what, if anything, that
means in the case of this target). */
-static int
-v850ice_wait (pid, status)
- int pid;
- struct target_waitstatus *status;
+static ptid_t
+v850ice_wait (ptid_t ptid, struct target_waitstatus *status)
{
long v850_status;
char buf[256];
{
long v850_status;
char buf[256];
@@
-496,13
+480,11
@@
v850ice_wait (pid, status)
}
while (!done);
}
while (!done);
- return inferior_pid;
+ return inferior_p
t
id;
}
static int
}
static int
-convert_register (regno, buf)
- int regno;
- char *buf;
+convert_register (int regno, char *buf)
{
if (regno <= 31)
sprintf (buf, "r%d", regno);
{
if (regno <= 31)
sprintf (buf, "r%d", regno);
@@
-521,8
+503,7
@@
convert_register (regno, buf)
convert it to target byte-order if necessary. */
static void
convert it to target byte-order if necessary. */
static void
-v850ice_fetch_registers (regno)
- int regno;
+v850ice_fetch_registers (int regno)
{
long retval;
char cmd[100];
{
long retval;
char cmd[100];
@@
-553,7
+534,7
@@
v850ice_fetch_registers (regno)
error ("v850ice_fetch_registers (%d): bad value from ICE: %s.",
regno, val);
error ("v850ice_fetch_registers (%d): bad value from ICE: %s.",
regno, val);
- store_unsigned_integer (val, REGISTER_RAW_SIZE (regno), regval);
+ store_unsigned_integer (val,
DEPRECATED_
REGISTER_RAW_SIZE (regno), regval);
supply_register (regno, val);
}
supply_register (regno, val);
}
@@
-561,8
+542,7
@@
v850ice_fetch_registers (regno)
of REGISTERS. */
static void
of REGISTERS. */
static void
-v850ice_store_registers (regno)
- int regno;
+v850ice_store_registers (int regno)
{
long retval;
char cmd[100];
{
long retval;
char cmd[100];
@@
-579,8
+559,8
@@
v850ice_store_registers (regno)
return;
}
return;
}
- regval = extract_unsigned_integer (&
registers[
REGISTER_BYTE (regno)],
- REGISTER_RAW_SIZE (regno));
+ regval = extract_unsigned_integer (&
deprecated_registers[DEPRECATED_
REGISTER_BYTE (regno)],
+
DEPRECATED_
REGISTER_RAW_SIZE (regno));
strcpy (cmd, "reg ");
if (!convert_register (regno, &cmd[4]))
return;
strcpy (cmd, "reg ");
if (!convert_register (regno, &cmd[4]))
return;
@@
-595,24
+575,20
@@
v850ice_store_registers (regno)
register at a time. */
static void
register at a time. */
static void
-v850ice_prepare_to_store ()
+v850ice_prepare_to_store (
void
)
{
}
/* Read or write LEN bytes from inferior memory at MEMADDR, transferring
to or from debugger address MYADDR. Write to inferior if SHOULD_WRITE is
{
}
/* Read or write LEN bytes from inferior memory at MEMADDR, transferring
to or from debugger address MYADDR. Write to inferior if SHOULD_WRITE is
- nonzero. Returns length of data written or read; 0 for error.
+ nonzero. TARGET is unused. Returns length of data written or read;
+ 0 for error.
We can only read/write MAX_BLOCK_SIZE bytes at a time, though, or the DLL
We can only read/write MAX_BLOCK_SIZE bytes at a time, though, or the DLL
- dies */
-/* ARGSUSED */
+ dies. */
static int
static int
-v850ice_xfer_memory (memaddr, myaddr, len, should_write, target)
- CORE_ADDR memaddr;
- char *myaddr;
- int len;
- int should_write;
- struct target_ops *target; /* ignored */
+v850ice_xfer_memory (CORE_ADDR memaddr, char *myaddr, int len,
+ int should_write, struct target_ops *target)
{
long retval;
char cmd[100];
{
long retval;
char cmd[100];
@@
-722,16
+698,13
@@
v850ice_xfer_memory (memaddr, myaddr, len, should_write, target)
}
static void
}
static void
-v850ice_files_info (ignore)
- struct target_ops *ignore;
+v850ice_files_info (struct target_ops *ignore)
{
puts_filtered ("Debugging a target via the NEC V850 ICE.\n");
}
static int
{
puts_filtered ("Debugging a target via the NEC V850 ICE.\n");
}
static int
-v850ice_insert_breakpoint (addr, contents_cache)
- CORE_ADDR addr;
- char *contents_cache;
+v850ice_insert_breakpoint (CORE_ADDR addr, char *contents_cache)
{
long retval;
char cmd[100];
{
long retval;
char cmd[100];
@@
-750,9
+723,7
@@
v850ice_insert_breakpoint (addr, contents_cache)
}
static int
}
static int
-v850ice_remove_breakpoint (addr, contents_cache)
- CORE_ADDR addr;
- char *contents_cache;
+v850ice_remove_breakpoint (CORE_ADDR addr, char *contents_cache)
{
long retval;
char cmd[100];
{
long retval;
char cmd[100];
@@
-772,21
+743,19
@@
v850ice_remove_breakpoint (addr, contents_cache)
}
static void
}
static void
-v850ice_kill ()
+v850ice_kill (
void
)
{
target_mourn_inferior ();
{
target_mourn_inferior ();
- inferior_p
id = 0
;
+ inferior_p
tid = null_ptid
;
}
static void
}
static void
-v850ice_mourn ()
+v850ice_mourn (
void
)
{
}
static void
{
}
static void
-v850ice_load (filename, from_tty)
- char *filename;
- int from_tty;
+v850ice_load (char *filename, int from_tty)
{
struct MessageIO iob;
char buf[256];
{
struct MessageIO iob;
char buf[256];
@@
-798,8
+767,7
@@
v850ice_load (filename, from_tty)
}
static int
}
static int
-ice_file (arg)
- char *arg;
+ice_file (char *arg)
{
char *s;
{
char *s;
@@
-822,11
+790,11
@@
ice_file (arg)
/* Must supress from_tty, otherwise we could start asking if the
user really wants to load a new symbol table, etc... */
printf_unfiltered ("Reading symbols from %s...", arg);
/* Must supress from_tty, otherwise we could start asking if the
user really wants to load a new symbol table, etc... */
printf_unfiltered ("Reading symbols from %s...", arg);
- exec_
file_command
(arg, 0);
- symbol_file_
command
(arg, 0);
+ exec_
open
(arg, 0);
+ symbol_file_
add_main
(arg, 0);
printf_unfiltered ("done\n");
printf_unfiltered ("done\n");
- /* exec_
file_command
will kill our target, so reinstall the ICE as
+ /* exec_
open
will kill our target, so reinstall the ICE as
the target. */
v850ice_open (NULL, 0);
the target. */
v850ice_open (NULL, 0);
@@
-835,8
+803,7
@@
ice_file (arg)
}
static int
}
static int
-ice_cont (c)
- char *c;
+ice_cont (char *c)
{
printf_filtered ("continue (ice)\n");
ReplyMessage ((LRESULT) 1);
{
printf_filtered ("continue (ice)\n");
ReplyMessage ((LRESULT) 1);
@@
-852,11
+819,7
@@
ice_cont (c)
}
static void
}
static void
-do_gdb (cmd, str, func, count)
- char *cmd;
- char *str;
- void (*func) (char *, int);
- int count;
+do_gdb (char *cmd, char *str, void (*func) (char *, int), int count)
{
ReplyMessage ((LRESULT) 1);
{
ReplyMessage ((LRESULT) 1);
@@
-875,8
+838,7
@@
do_gdb (cmd, str, func, count)
static int
static int
-ice_stepi (c)
- char *c;
+ice_stepi (char *c)
{
int count = (int) c;
{
int count = (int) c;
@@
-885,8
+847,7
@@
ice_stepi (c)
}
static int
}
static int
-ice_nexti (c)
- char *c;
+ice_nexti (char *c)
{
int count = (int) c;
{
int count = (int) c;
@@
-895,9
+856,7
@@
ice_nexti (c)
}
static void
}
static void
-v850ice_command (arg, from_tty)
- char *arg;
- int from_tty;
+v850ice_command (char *arg, int from_tty)
{
struct MessageIO iob;
char buf[256];
{
struct MessageIO iob;
char buf[256];
@@
-915,8
+874,7
@@
togdb_force_update (void)
}
static void
}
static void
-view_source (addr)
- CORE_ADDR addr;
+view_source (CORE_ADDR addr)
{
char c[256];
{
char c[256];
@@
-937,14
+895,9
@@
init_850ice_ops (void)
v850ice_ops.to_doc = "Debug a system controlled by a NEC 850 ICE.";
v850ice_ops.to_open = v850ice_open;
v850ice_ops.to_close = v850ice_close;
v850ice_ops.to_doc = "Debug a system controlled by a NEC 850 ICE.";
v850ice_ops.to_open = v850ice_open;
v850ice_ops.to_close = v850ice_close;
- v850ice_ops.to_attach = NULL;
- v850ice_ops.to_post_attach = NULL;
- v850ice_ops.to_require_attach = NULL;
v850ice_ops.to_detach = v850ice_detach;
v850ice_ops.to_detach = v850ice_detach;
- v850ice_ops.to_require_detach = NULL;
v850ice_ops.to_resume = v850ice_resume;
v850ice_ops.to_wait = v850ice_wait;
v850ice_ops.to_resume = v850ice_resume;
v850ice_ops.to_wait = v850ice_wait;
- v850ice_ops.to_post_wait = NULL;
v850ice_ops.to_fetch_registers = v850ice_fetch_registers;
v850ice_ops.to_store_registers = v850ice_store_registers;
v850ice_ops.to_prepare_to_store = v850ice_prepare_to_store;
v850ice_ops.to_fetch_registers = v850ice_fetch_registers;
v850ice_ops.to_store_registers = v850ice_store_registers;
v850ice_ops.to_prepare_to_store = v850ice_prepare_to_store;
@@
-952,36
+905,21
@@
init_850ice_ops (void)
v850ice_ops.to_files_info = v850ice_files_info;
v850ice_ops.to_insert_breakpoint = v850ice_insert_breakpoint;
v850ice_ops.to_remove_breakpoint = v850ice_remove_breakpoint;
v850ice_ops.to_files_info = v850ice_files_info;
v850ice_ops.to_insert_breakpoint = v850ice_insert_breakpoint;
v850ice_ops.to_remove_breakpoint = v850ice_remove_breakpoint;
- v850ice_ops.to_terminal_init = NULL;
- v850ice_ops.to_terminal_inferior = NULL;
- v850ice_ops.to_terminal_ours_for_output = NULL;
- v850ice_ops.to_terminal_ours = NULL;
- v850ice_ops.to_terminal_info = NULL;
v850ice_ops.to_kill = v850ice_kill;
v850ice_ops.to_load = v850ice_load;
v850ice_ops.to_kill = v850ice_kill;
v850ice_ops.to_load = v850ice_load;
- v850ice_ops.to_lookup_symbol = NULL;
- v850ice_ops.to_create_inferior = NULL;
v850ice_ops.to_mourn_inferior = v850ice_mourn;
v850ice_ops.to_mourn_inferior = v850ice_mourn;
- v850ice_ops.to_can_run = 0;
- v850ice_ops.to_notice_signals = 0;
- v850ice_ops.to_thread_alive = NULL;
v850ice_ops.to_stop = v850ice_stop;
v850ice_ops.to_stop = v850ice_stop;
- v850ice_ops.to_pid_to_exec_file = NULL;
- v850ice_ops.to_core_file_to_sym_file = NULL;
v850ice_ops.to_stratum = process_stratum;
v850ice_ops.to_stratum = process_stratum;
- v850ice_ops.DONT_USE = NULL;
v850ice_ops.to_has_all_memory = 1;
v850ice_ops.to_has_memory = 1;
v850ice_ops.to_has_stack = 1;
v850ice_ops.to_has_registers = 1;
v850ice_ops.to_has_execution = 1;
v850ice_ops.to_has_all_memory = 1;
v850ice_ops.to_has_memory = 1;
v850ice_ops.to_has_stack = 1;
v850ice_ops.to_has_registers = 1;
v850ice_ops.to_has_execution = 1;
- v850ice_ops.to_sections = NULL;
- v850ice_ops.to_sections_end = NULL;
v850ice_ops.to_magic = OPS_MAGIC;
}
void
v850ice_ops.to_magic = OPS_MAGIC;
}
void
-_initialize_v850ice ()
+_initialize_v850ice (
void
)
{
init_850ice_ops ();
add_target (&v850ice_ops);
{
init_850ice_ops ();
add_target (&v850ice_ops);
This page took
0.029767 seconds
and
4
git commands to generate.