FreeBSD Bugzilla – Attachment 28724 Details for
Bug 48183
[patch] gdb(1) on a core(5)-file from a threaded process can't see
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
Remember
[x]
|
Forgot Password
Login:
[x]
[patch]
file.diff
file.diff (text/plain), 4.20 KB, created by
Peter Edwards
on 2003-02-11 19:10:09 UTC
(
hide
)
Description:
file.diff
Filename:
MIME Type:
Creator:
Peter Edwards
Created:
2003-02-11 19:10:09 UTC
Size:
4.20 KB
patch
obsolete
>Index: freebsd-uthread.c >=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= >=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= >=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D >RCS file: >/pub/FreeBSD/development/FreeBSD-CVS/src/gnu/usr.bin/binutils/gdb/freebsd >-uthread.c,v >retrieving revision 1.10 >diff -u -r1.10 freebsd-uthread.c >--- freebsd-uthread.c 4 Jan 2003 17:35:54 -0000 1.10 >+++ freebsd-uthread.c 7 Feb 2003 12:34:19 -0000 >@@ -46,6 +46,10 @@ > #include <sys/stat.h> > #include "gdbcore.h" >=20 >+int coreops_suppress_target =3D 1; /* Ugh. Override the version in >corelow.c. */ >+extern struct target_ops core_ops; /* target vector for corelow.c */ >+static struct target_ops orig_core_ops; /* target vector for corelow.c */ >+ > extern int child_suppress_run; > extern struct target_ops child_ops; /* target vector for inftarg.c */ >=20 >@@ -60,6 +64,7 @@ >=20 > /* Pointer to the next function on the objfile event chain. */ > static void (*target_new_objfile_chain) (struct objfile *objfile); >+static void freebsd_uthread_find_new_threads (void); >=20 > static void freebsd_uthread_resume PARAMS ((ptid_t pid, int step, > enum target_signal signo)); >@@ -472,7 +477,10 @@ >=20 > if (freebsd_uthread_attaching || TIDGET(inferior_ptid) =3D=3D 0) > { >- child_ops.to_fetch_registers (regno); >+ if (target_has_execution) >+ child_ops.to_fetch_registers (regno); >+ else >+ orig_core_ops.to_fetch_registers (regno); > return; > } >=20 >@@ -481,7 +489,10 @@ >=20 > if (active) > { >- child_ops.to_fetch_registers (regno); >+ if (target_has_execution) >+ child_ops.to_fetch_registers (regno); >+ else >+ orig_core_ops.to_fetch_registers (regno); > return; > } >=20 >@@ -501,8 +512,12 @@ >=20 > for (regno =3D first_regno; regno <=3D last_regno; regno++) > { >- if (regmap[regno] =3D=3D -1) >- child_ops.to_fetch_registers (regno); >+ if (regmap[regno] =3D=3D -1) { >+ if (target_has_execution) >+ child_ops.to_fetch_registers (regno); >+ else >+ orig_core_ops.to_fetch_registers (regno); >+ } > else > if (thread) > supply_register (regno, (char*) ®base[regmap[regno]]); >@@ -683,6 +698,11 @@ > LOOKUP_VALUE(PS_RUNNING); > LOOKUP_VALUE(PS_DEAD); >=20 >+ if (!target_has_execution) { >+ read_thread_offsets(); >+ freebsd_uthread_find_new_threads(); >+ } >+ > freebsd_uthread_active =3D 1; > } >=20 >@@ -731,6 +751,27 @@ > return ret; > } >=20 >+static int >+freebsd_utcore_thread_alive (ptid_t ptid) >+{ >+ return 1; >+} >+ >+static void >+freebsd_utcore_attach (char *args, int from_tty) >+{ >+ orig_core_ops.to_attach (args, from_tty); >+ push_target (&core_ops); >+ freebsd_uthread_attaching =3D 1; >+} >+ >+static void >+freebsd_utcore_detach (char *args, int from_tty) >+{ >+ unpush_target (&core_ops); >+ orig_core_ops.to_detach (args, from_tty); >+} >+ > static void > freebsd_uthread_stop (void) > { >@@ -874,12 +915,41 @@ > freebsd_uthread_vec.get_thread_info =3D freebsd_uthread_get_thread_info; > #endif > } >+=0C >+ >+ >+static void >+init_freebsd_core_ops () >+{ >+ orig_core_ops =3D core_ops; >+ core_ops.to_shortname =3D "freebsd-uthreads (corefile)"; >+ core_ops.to_longname =3D "FreeBSD uthreads (corefile)"; >+ core_ops.to_doc =3D "FreeBSD user threads support (for corefiles)."; >+ core_ops.to_has_all_memory =3D 0; >+ core_ops.to_has_memory =3D 1; >+ core_ops.to_has_stack =3D 1; >+ core_ops.to_has_registers =3D 1; >+ core_ops.to_has_execution =3D 0; >+ core_ops.to_has_thread_control =3D tc_none; >+ core_ops.to_magic =3D OPS_MAGIC; >+ core_ops.to_pid_to_str =3D freebsd_uthread_pid_to_str; >+ core_ops.to_thread_alive =3D freebsd_utcore_thread_alive; >+ core_ops.to_attach =3D freebsd_utcore_attach; >+ core_ops.to_detach =3D freebsd_utcore_detach; >+ core_ops.to_stratum =3D core_stratum; >+ core_ops.to_find_new_threads =3D freebsd_uthread_find_new_threads; >+ core_ops.to_fetch_registers =3D freebsd_uthread_fetch_registers; >+ core_ops.to_sections =3D 0; >+ core_ops.to_sections_end =3D 0; >+} >=20 > void > _initialize_freebsd_uthread () > { > init_freebsd_uthread_ops (); >+ init_freebsd_core_ops (); > add_target (&freebsd_uthread_ops); >+ add_target (&core_ops); >=20 > target_new_objfile_chain =3D target_new_objfile_hook; > target_new_objfile_hook =3D freebsd_uthread_new_objfile;
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
Attachments on
bug 48183
: 28724