comp.lang.ada
 help / color / mirror / Atom feed
* Debugging Ada
@ 2011-12-21 15:14 awdorrin
  2011-12-21 16:45 ` Ludovic Brenta
  2011-12-22 10:28 ` Gautier write-only
  0 siblings, 2 replies; 12+ messages in thread
From: awdorrin @ 2011-12-21 15:14 UTC (permalink / raw)


I am having an odd problem with a multi-threaded application that is a
combination of C and Ada.

During elaboration, the Ada code is setting a constant string that it
retrieves from another package:

LAN_CFG_FILE : constant String := SysConfig.Cfg_Filename( LAN_CFG );

Then in the package's main procedure when I try to use the
LAN_CFG_FILE, sometimes the value is corrupted. I realize that
something is either blowing a buffer, or there is a threading issue
that is corrupting the stack, however here is my problem:

When I try to get the address of LAN_CFG_FILE in GDB, so I can set a
watch, I get the response:

"Attempt to take address of value not located in memory."

For example:
(gdb) p LAN_CFG_FILE
$7 = "/home/aldorr/config/lan.cfg"
(gdb) p LAN_CFG_FILE'Address
Attempt to take address of value not located in memory.
(gdb) p &LAN_CFG_FILE
Attempt to take address of value not located in memory.

I really am not sure why the print of the variable works, but I can't
determine where the variable is located...

This may not be an Ada issue, but more a GDB issue - but figured any
GDB forums would likely not have the Ada expertise that this forum
would.

-Al





^ permalink raw reply	[flat|nested] 12+ messages in thread

end of thread, other threads:[~2011-12-22 12:20 UTC | newest]

Thread overview: 12+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2011-12-21 15:14 Debugging Ada awdorrin
2011-12-21 16:45 ` Ludovic Brenta
2011-12-21 16:51   ` awdorrin
2011-12-21 17:18     ` Ludovic Brenta
2011-12-21 17:36       ` awdorrin
2011-12-21 18:06         ` Simon Wright
2011-12-21 18:43           ` awdorrin
2011-12-21 19:46         ` Ludovic Brenta
2011-12-22  7:21           ` Adam Beneschan
2011-12-22  8:39             ` Ludovic Brenta
2011-12-22 12:20             ` awdorrin
2011-12-22 10:28 ` Gautier write-only

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox