This is the mail archive of the gdb@sources.redhat.com mailing list for the GDB project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

There is always a thread


(Goes nicely with the `there is always a frame' dogma, but I've a patch for that one :-)

GDB contains the function:

void
load_infrun_state (ptid_t ptid, ...)
{
struct thread_info *tp;

/* If we can't find the thread, then we're debugging a single threaded
process. No need to do anything in that case. */
tp = find_thread_id (pid_to_thread_id (ptid));
if (tp == NULL)
return;

*prev_pc = tp->prev_pc;
*prev_func_start = tp->prev_func_start;
*prev_func_name = tp->prev_func_name;
*trap_expected = tp->trap_expected;
...;
}

where what is being modified (even though it's all nicely parameterized) are global variables (see "inferior.h").

Anywone interested in trying to change this so that, instead, it assumes that `there is always a thread' and hence, not constantly swap thread and global variables.

Andrew


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]