X-Git-Url: http://drtracing.org/?a=blobdiff_plain;f=gdb%2Fsol-thread.c;h=13b9580109260865298f725aaa4d4eb6c159de46;hb=e7494ffb7117d0f6291ab03434a7d326a60c4154;hp=f92c49e4b3f8f53b0d2018b4127b412d5bf2765b;hpb=ca6724c16a360b6297d7827cfd0173441ccd95c2;p=deliverable%2Fbinutils-gdb.git diff --git a/gdb/sol-thread.c b/gdb/sol-thread.c index f92c49e4b3..13b9580109 100644 --- a/gdb/sol-thread.c +++ b/gdb/sol-thread.c @@ -1,5 +1,5 @@ /* Low level interface for debugging Solaris threads for GDB, the GNU debugger. - Copyright 1996, 1997, 1998, 1999, 2000, 2001 + Copyright 1996, 1997, 1998, 1999, 2000, 2001, 2002 Free Software Foundation, Inc. This file is part of GDB. @@ -60,6 +60,7 @@ #include "gdbcmd.h" #include "gdbcore.h" #include "regcache.h" +#include "symfile.h" extern struct target_ops sol_thread_ops; /* Forward declaration */ extern struct target_ops sol_core_ops; /* Forward declaration */ @@ -415,7 +416,7 @@ sol_thread_attach (char *args, int from_tty) procfs_ops.to_attach (args, from_tty); /* Must get symbols from solibs before libthread_db can run! */ - SOLIB_ADD ((char *) 0, from_tty, (struct target_ops *) 0); + SOLIB_ADD ((char *) 0, from_tty, (struct target_ops *) 0, auto_solib_add); if (sol_thread_active) { @@ -647,7 +648,8 @@ sol_thread_store_registers (int regno) { /* Not writing all the regs */ /* save new register value */ char* old_value = (char*) alloca (REGISTER_SIZE); - memcpy (old_value, ®isters[REGISTER_BYTE (regno)], REGISTER_SIZE); + memcpy (old_value, &deprecated_registers[REGISTER_BYTE (regno)], + REGISTER_SIZE); val = p_td_thr_getgregs (&thandle, gregset); if (val != TD_OK) @@ -659,7 +661,8 @@ sol_thread_store_registers (int regno) td_err_string (val)); /* restore new register value */ - memcpy (®isters[REGISTER_BYTE (regno)], old_value, REGISTER_SIZE); + memcpy (&deprecated_registers[REGISTER_BYTE (regno)], old_value, + REGISTER_SIZE); #if 0 /* thread_db doesn't seem to handle this right */ @@ -1509,6 +1512,22 @@ info_solthreads (char *args, int from_tty) TD_SIGNO_MASK, TD_THR_ANY_USER_FLAGS); } +static int +sol_find_memory_regions (int (*func) (CORE_ADDR, + unsigned long, + int, int, int, + void *), + void *data) +{ + return procfs_ops.to_find_memory_regions (func, data); +} + +static char * +sol_make_note_section (bfd *obfd, int *note_size) +{ + return procfs_ops.to_make_corefile_notes (obfd, note_size); +} + static int ignore (CORE_ADDR addr, char *contents) { @@ -1523,7 +1542,6 @@ init_sol_thread_ops (void) sol_thread_ops.to_longname = "Solaris threads and pthread."; sol_thread_ops.to_doc = "Solaris threads and pthread support."; sol_thread_ops.to_open = sol_thread_open; - sol_thread_ops.to_close = 0; sol_thread_ops.to_attach = sol_thread_attach; sol_thread_ops.to_detach = sol_thread_detach; sol_thread_ops.to_resume = sol_thread_resume; @@ -1539,10 +1557,9 @@ init_sol_thread_ops (void) sol_thread_ops.to_terminal_inferior = terminal_inferior; sol_thread_ops.to_terminal_ours_for_output = terminal_ours_for_output; sol_thread_ops.to_terminal_ours = terminal_ours; + sol_thread_ops.to_terminal_save_ours = terminal_save_ours; sol_thread_ops.to_terminal_info = child_terminal_info; sol_thread_ops.to_kill = sol_thread_kill_inferior; - sol_thread_ops.to_load = 0; - sol_thread_ops.to_lookup_symbol = 0; sol_thread_ops.to_create_inferior = sol_thread_create_inferior; sol_thread_ops.to_mourn_inferior = sol_thread_mourn_inferior; sol_thread_ops.to_can_run = sol_thread_can_run; @@ -1558,8 +1575,8 @@ init_sol_thread_ops (void) sol_thread_ops.to_has_registers = 1; sol_thread_ops.to_has_execution = 1; sol_thread_ops.to_has_thread_control = tc_none; - sol_thread_ops.to_sections = 0; - sol_thread_ops.to_sections_end = 0; + sol_thread_ops.to_find_memory_regions = sol_find_memory_regions; + sol_thread_ops.to_make_corefile_notes = sol_make_note_section; sol_thread_ops.to_magic = OPS_MAGIC; } @@ -1574,30 +1591,16 @@ init_sol_core_ops (void) sol_core_ops.to_close = sol_core_close; sol_core_ops.to_attach = sol_thread_attach; sol_core_ops.to_detach = sol_core_detach; - /* sol_core_ops.to_resume = 0; */ - /* sol_core_ops.to_wait = 0; */ sol_core_ops.to_fetch_registers = sol_thread_fetch_registers; - /* sol_core_ops.to_store_registers = 0; */ - /* sol_core_ops.to_prepare_to_store = 0; */ sol_core_ops.to_xfer_memory = sol_thread_xfer_memory; sol_core_ops.to_files_info = sol_core_files_info; sol_core_ops.to_insert_breakpoint = ignore; sol_core_ops.to_remove_breakpoint = ignore; - /* sol_core_ops.to_terminal_init = 0; */ - /* sol_core_ops.to_terminal_inferior = 0; */ - /* sol_core_ops.to_terminal_ours_for_output = 0; */ - /* sol_core_ops.to_terminal_ours = 0; */ - /* sol_core_ops.to_terminal_info = 0; */ - /* sol_core_ops.to_kill = 0; */ - /* sol_core_ops.to_load = 0; */ - /* sol_core_ops.to_lookup_symbol = 0; */ sol_core_ops.to_create_inferior = sol_thread_create_inferior; sol_core_ops.to_stratum = core_stratum; - sol_core_ops.to_has_all_memory = 0; sol_core_ops.to_has_memory = 1; sol_core_ops.to_has_stack = 1; sol_core_ops.to_has_registers = 1; - sol_core_ops.to_has_execution = 0; sol_core_ops.to_has_thread_control = tc_none; sol_core_ops.to_thread_alive = sol_thread_alive; sol_core_ops.to_pid_to_str = solaris_pid_to_str; @@ -1606,8 +1609,6 @@ init_sol_core_ops (void) in procinfo list" where is the pid of the process that produced the core file. Disable it for now. */ /* sol_core_ops.to_find_new_threads = sol_find_new_threads; */ - sol_core_ops.to_sections = 0; - sol_core_ops.to_sections_end = 0; sol_core_ops.to_magic = OPS_MAGIC; }