T.R | Title | User | Personal Name | Date | Lines |
---|
3422.1 | couldn't reproduce the problem... | DECC::J_WARD | | Mon Feb 03 1997 11:49 | 77 |
|
Is MoreEntries() inlined? Did you compile with -g?
"If a program is no compiled with the -g flag, a breakpoint
set on an inline member function may confuse the debugger."
(From ladebug manual)
Since you didn't give a complete source code example, I tried
reproducing your problem with this and it seemed to work just
fine...
// cache.cpp
#include <stdio.h>
template<class CACHE_DATA_T>
class Cache_t {
private:
struct Entry_t {
CACHE_DATA_T data;
Entry_t *nextEntry;
};
//Entries are allocated in blocks.
struct CbListEntry_t{
void *cacheblock;
CbListEntry_t *nextCbListEntry;
};
Entry_t *firstEntry;
Entry_t *freeEntry;
CbListEntry_t cb;
//MoreEntries - Allocates space for cache entries and updates freeEntry.
//Returns 1 if one or more entries added to free list.
//Returns 0 if no memory.
int MoreEntries() { printf("inside MoreEntries\n"); return 0; }
public:
//Add a new entry to the cache.
//Returns 1 if ok. 0 if not enough memory.
int Added(const CACHE_DATA_T &newEntry);
//Delete an entry from the cache.
void Delete(const CACHE_DATA_T &selectedEntry);
//Search the cache.
//Returns 1 and result in selectedEntry if found.
//Returns 0 if not found.
int Found(CACHE_DATA_T *selectedEntry);
//Constructor.
Cache_t() { MoreEntries();}
//Destructor.
~Cache_t() {;}
};
void main() {
Cache_t<int> tcc;
Cache_t<char> tbc;
Cache_t<float> rbc;
}
cosf.zko.dec.com> cxx -g cache.cpp
cosf.zko.dec.com> ladebug a.out
Welcome to the Ladebug Debugger Version 4.0-26
------------------
object file name: a.out
Reading symbolic information ...done
(ladebug) b 24
[#1: stop at "cache.cpp":24 ]
(ladebug) run
[1] stopped at [int Cache_t<int>::MoreEntries(void):24 0x120002390]
24 int MoreEntries() { printf("inside MoreEntries\n"); return 0; }
(ladebug) quit
|
3422.2 | The source is in multiple files... | GALVIA::STONES | Tom Stones | Mon Feb 03 1997 12:34 | 93 |
| Here's what happened with a shortened version of my code:
zen> cxx -g trash.cxx cache.cxx -I.
trash.cxx:
cache.cxx:
zen> ladebug a.out
Welcome to the Ladebug Debugger Version 4.0-19
------------------
object file name: a.out
Reading symbolic information ...done
(ladebug) bp main
[#1: stop in int main(void) ]
(ladebug) r
[1] stopped at [int main(void):6 0x120002418]
6 Cache_t<int> tcc;
(ladebug) s
stopped at [Cache_t<int>::Cache_t<int>(void):31 0x1200023e0]
31 Cache_t() { MoreEntries();}
(ladebug) s
stopped at [int Cache_t<int>::MoreEntries(void):6 0x120002318]
6 int Cache_t<CACHE_DATA_T>::MoreEntries() {
(ladebug) l
7 int i;
8 printf("inside MoreEntries\n");
9 i = 99;
10 return 0;
11 }
12
(ladebug) b 9
Warning: More than one file named './cache.cxx' found in the binary.
Warning: Breakpoint not set
(ladebug) q
Here's the code:
//main.cxx
#include <cache.h>
void main() {
Cache_t<int> tcc;
Cache_t<char> tbc;
Cache_t<float> rbc;
}
// cache.cpp
#include <stdio.h>
#include "cache.h"
template<class CACHE_DATA_T>
int Cache_t<CACHE_DATA_T>::MoreEntries() {
int i;
printf("inside MoreEntries\n");
i = 99;
return 0;
}
// cache.h
#ifndef CACHE_
#define CACHE_
template<class CACHE_DATA_T>
class Cache_t {
private:
struct Entry_t {
CACHE_DATA_T data;
Entry_t *nextEntry;
};
//Entries are allocated in blocks.
struct CbListEntry_t{
void *cacheblock;
CbListEntry_t *nextCbListEntry;
};
Entry_t *firstEntry;
Entry_t *freeEntry;
CbListEntry_t cb;
//MoreEntries - Allocates space for cache entries and updates freeEntry.
//Returns 1 if one or more entries added to free list.
//Returns 0 if no memory.
int MoreEntries();
public:
//Constructor.
Cache_t() { MoreEntries();}
};
#endif
|
3422.3 | I see the problem... | DECC::J_WARD | | Mon Feb 03 1997 14:07 | 11 |
|
But I don't know of a solution.
You should probably try posting your example
in .2 to the ladebug notes conference,
TURRIS::DECLADEBUG
I'd be curious to find out how to do this too...
I'm sure it has something to do with the
instantiations being in repository files.
|
3422.4 | FYI | DECC::J_WARD | | Thu Feb 06 1997 17:09 | 3 |
|
This note was cross-posted in decladebug notes conference
note 808. No answer yet.
|