LinuxQuestions.org
Latest LQ Deal: Latest LQ Deals
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Blogs > Aquarius_Girl
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 Aquarius_Girl
Updated 01-18-2012 at 09:48 AM by Aquarius_Girl

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 13135 Comments 0 Aquarius_Girl is offline
Old

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

Posted 01-10-2012 at 06:12 AM by Aquarius_Girl
Updated 02-03-2012 at 05:32 AM by Aquarius_Girl (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 18581 Comments 3 Aquarius_Girl is offline

  



All times are GMT -5. The time now is 03:35 AM.

Main Menu
Advertisement
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
Open Source Consulting | Domain Registration