From: Satish Balay (balay_at_mcs.anl.gov)
Date: Wed Apr 03 2002 - 06:09:40 BST
UPS developers,
I'd like to be able to debug the following example
>>>>>>
localhost:/home/balay/junk>cat x.c
typedef struct _p_Vec* Vec;
int main(void)
{
Vec v;
VecCreate(&v);
v = 0;
}
localhost:/home/balay/junk>cat y.c
typedef struct _p_Vec* Vec;
struct _p_Vec {
int a[10];
char *type;
}
VecCreate(Vec *v)
{
*v= (Vec)malloc(sizeof(struct _p_Vec ));
}
localhost:/home/balay/junk>gcc -g x.c y.c
localhost:/home/balay/junk>ups a.out
>>>>
place a breakpoint at x.c:7 < code: v = 0 >
I'd like to be able to click on v - and the debugger - resolves
the type properly (from the info in y.c or something)
Currently 'Expand' on 'v' gives 'v is not a structure or union'
But gdb does resolve this structure properly
(gdb) p *v
$1 = {a = {-1073742899, 0, -1073742876, -1073742855, -1073742820, -1073742807,
-1073742790, -1073742759, -1073742719, -1073742702},
type = 0xbffffcae "LESSOPEN=|/usr/bin/lesspipe.sh %s"}
We use this design extensively - and because of it - I'm stuck to using
gdb for debugging. I'd appreciate if this can be added to ups.
Thanks,
Satish
This archive was generated by hypermail 2.1.4 : Thu May 23 2002 - 15:54:03 BST