[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Viewing complex linked-lists in DDD
From: |
jshamlet |
Subject: |
Viewing complex linked-lists in DDD |
Date: |
Wed, 02 Nov 2005 21:53:22 +0000 |
Guys,
I have run into a snag with a program framework I am trying to develop. This is
the first "complex" C program I have tried to write, so if I am heading down an
obvious wrong path, I would appreciate a heads up!
First, I am developing on FreeBSD 4.11-REL with gcc 2.95.4, and gdb 4.18. The
ddd version is 3.10.
Everything seems to work, except for one thing - viewing the contents of
"master" linked lists. My program is essentially a framework for modules, and
is intended to provide shared access to serial ports, as well as provide
network communication. It operates around the concept of "tasks". The scheduler
maintains a global linked list called "TaskList", comprised of structures
called "Task's".
To handle inter-task messaging, I have a similar system where the messaging
subsystem maintains a global linked-list called MailRoom. The basic program
logic is almost identical to the TaskList logic.
Within the MailRoom, each task is assigned a MailBox, in much the same way it
is assigned a Task structure. The MailBox structure is comprised of two
elements, an integer (MailBoxID) and a pointer to another linked list (Inbox).
The task manager is responsible for creating the MailBox when the task is
initialized, setting up the MailBoxID (which is just the owners TaskID), and
creating an empty linked list for the Inbox.
When one task wants to send a message to another, it calls the add_mail_mesg()
function, which mallocs a new structure called "Mesg", comprised of the sender
task's ID and a pointer to the message body (which can be anything - the
protocol is up to the tasks).
The problem is that when a task sends a message I get a segfault somewhere in
the messaging subsystem when the mailbox owner attempts to read it. I have
traced it down to an attempt to use an empty inbox.
Now, my problem with DDD is that when I try to view the global structure
"MailRoom", it correctly identifies it as a linked-list - but when I try to
keep going, by opening "current", it says the display is disabled. I can, if I
am in scope, link it to the current MailRoom, but as soon as I leave the
current function, the link disappears.
Am I just missing something here, or shouldn't the contents of MailRoom be
available at all times, since it is a global? It would be MUCH easier to find
the source of this bug if I could watch the value of current change in the
MailRoom.
Thanks,
Seth Henry
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- Viewing complex linked-lists in DDD,
jshamlet <=