Here is the part of code where I want to set it :
void *sync(void *ptr) {
vector<short> gen = generate_sygnal();
I build my program with debug flag and Here is what I do in gdb:
(gdb) break daemon.cxx:sync
break daemon.cxx:sync
Breakpoint 1 at 0x804d080: file /home/username/projects/armd/complex/daemon/daemon.cxx, line 160.
(gdb) watch gen
watch gen
No symbol "gen" in current context.
(gdb) run
run
Starting program: /home/username/projects/armd/complex/build/daemon/daemon
[Thread debugging using libthread_db enabled]
Using host libthread_db library "/lib/libthread_db.so.1".
2012/05/02 11:00:32 error: Cannot open configuration file /home/username/projects/armd/complex/build/daemon/armd.conf
[New Thread 0xb7fe7b40 (LWP 4329)]
2012/05/02 11:00:32 info: Listening on port 2000
/dev/ttyS0 port opened!
[New Thread 0xb77e6b40 (LWP 4330)]
[Switching to Thread 0xb77e6b40 (LWP 4330)]
Breakpoint 1, sync (ptr=0x8055108)
at /home/username/projects/armd/complex/daemon/daemon.cxx:160
160 void *sync(void *ptr) {
(gdb) watch gen
watch gen
No symbol "gen" in current context.
(gdb)
So how can I check my gen values with gdb? Even I need full stack of vector values.
Step one more line into sync()
so the variable will actually be in scope (use GDB's next
command).