LinuxQuestions.org
Download your favorite Linux distribution at LQ ISO.
Go Back   LinuxQuestions.org > Blogs > TheIndependentAquarius
User Name
Password

Notices

GNU GDB
Old

Setting watchpoint for watching writes on a variable in C++ - GDB

Posted 01-16-2012 at 06:14 AM by TheIndependentAquarius
Updated 01-18-2012 at 09:48 AM by TheIndependentAquarius

Watchpoint basics:
  • Watchpoints are set on the variables, not on the functions or on the lines of code.
  • When the watched variables are read or written, the watchpoint gets triggered and the program's execution stops.

Watchpoints on non-global variables:
  • To set a watchpoint on a non-global variable, we must first set a breakpoint that will stop the program in the scope of the variable to be watched.
  • The watchpoint can be set after the program stops at the above set breakpoint.
  • To
...
Senior Member
Posted in GNU GDB
Views 3070 Comments 0 TheIndependentAquarius is offline
Old

How to pass command line arguments to main() through GDB? - C

Posted 01-10-2012 at 06:12 AM by TheIndependentAquarius
Updated 02-03-2012 at 05:32 AM by TheIndependentAquarius (Thanks to Mr.Code for pointing out the nonsense)

test.c
Code:
#include <stdio.h>
#include <string.h>

int main (int argc, char *argv[])
{
   if (argc >= 2)
   { 
      int i;
      for (i = 1; i < argc; i++)
         printf ("\nHaalloo! %s", argv[i]);
   }
   else
      printf ("\nForgot to key in something?");

   return 0;
}
Passing command line arguments to main() through...
Senior Member
Posted in GNU GDB
Views 10804 Comments 3 TheIndependentAquarius is offline

  



All times are GMT -5. The time now is 08:04 PM.

Main Menu
Advertisement

My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration