Sponsored Content
Full Discussion: Display Date and Time in GDB
Top Forums UNIX for Dummies Questions & Answers Display Date and Time in GDB Post 302805617 by gregthelaw on Friday 10th of May 2013 01:07:05 PM
Old 05-10-2013
printing the time from gdb

I don't know of a way to do it directly, but you can issue shell commands using the 'shell' command. e.g.

Code:
(undodb-gdb) shell date
Fri May 10 18:03:47 BST 2013
(undodb-gdb)

will tell you the time from the gdb prompt. To have this happen automagically each time a breakpoint is hit or whatever, you can use a stop hook:

Code:
(undodb-gdb) define hook-stop
Type commands for definition of "hook-stop".
End with a line saying just "end".
>shell date
>end
(undodb-gdb) next
Fri May 10 18:03:54 BST 2013
25          c++;
(undodb-gdb) next
Fri May 10 18:03:55 BST 2013
26          x = add (2);
(undodb-gdb) next
After +2 a=3, b=4, c=5
Fri May 10 18:03:56 BST 2013
27          a++;
(undodb-gdb)

Note that I'm using UndoDB above, but it's the same interface as gdb (actually, it uses gdb as a frontend). You can see more about UndoDB here at undo-software.com
This User Gave Thanks to gregthelaw For This Post:
 

10 More Discussions You Might Find Interesting

1. UNIX for Dummies Questions & Answers

Script to display last login date/time?

I was wondering if anyone had a script that would display the last time a user logged into a particular machine. I know about the "last" command, but it gives too much info.... I just wanted to know the last time a user used his/her id. ANy help would be greatly appreciated. Ryan (3 Replies)
Discussion started by: ryaneverett5
3 Replies

2. Solaris

display date n Time

Hi Friends, Can any one guide me regarding 'Display the date and time' command other than the command 'date' thanks n regards SsRrIi (1 Reply)
Discussion started by: SsRrIi
1 Replies

3. AIX

Unable to display the date-time in seconds on AIX

Hi, In unix the command "date +%s" displays the date-time in seconds since â00:00:00 1970-01-01 UTCâ (a GNU extension) when executed on unix: -sh-2.05b$ date +%s 1152092690 I tried with all the format control output but unable to display the date-time in seconds i,e as in unix format. Can... (6 Replies)
Discussion started by: me_haroon
6 Replies

4. UNIX for Dummies Questions & Answers

unable to display the souce line in gdb

Hi All, I am unable to display the code in gdb. When i put list command i dont get any line. I mean i am unable to display the source line in gdb. Can any body help me. Thanks & Regards Gauri (4 Replies)
Discussion started by: gauri
4 Replies

5. Shell Programming and Scripting

date and time to display on the terminal

hi all, am trying to 'grep' some text from a log file and use the 'cut' command to read from that line i just grep'ed to extract date/time and response times. code sniplet i am using is : grep -i 'text to grep' Out.log | while read LINE; do ... (11 Replies)
Discussion started by: cesarNZ
11 Replies

6. Programming

Incorrect address display by GDB

Hi, On using GDB debugger on different executables, the address displayed for the symbols seem incorrect, as it shows me the same address in each prorgram, run simultaneoulsy. eg: Program: linkmain1.c Breakpoint 1, main () at linkmain1.c:14 14 printf("In linkmain1.c\n"); (gdb)... (0 Replies)
Discussion started by: karthikb23
0 Replies

7. UNIX for Dummies Questions & Answers

How to always display date/time regardless of directory?

I found via Google a way to show the date and time stamp once I log in. However, whenever I cd to another directory it doesn't display the correct path. Here are the relevant parts from my .kshrc : unset _h _m _s eval $(date "+_h=%H ;_m=%M ;_s=%S") ((SECONDS =... (3 Replies)
Discussion started by: Mike F.
3 Replies

8. Shell Programming and Scripting

How to display a date, 30 days from the current date?

Well guys, I know the right syntax for displaying the current date is $(date). However, I am planning to send emails to some customers which displays their subscription date, and then the expiry. The expiry being 30 days from the current date. What would the right syntax be? (6 Replies)
Discussion started by: xxxx
6 Replies

9. Shell Programming and Scripting

Display files created on particular date & time

Hi , I have BASH system & i am trying to display the files created on a particular date and time, and after displaying those files I also want to delete all those files.Can anyone of you help me out for this............. Thanx Original post contents restored... Please do not erase the question... (3 Replies)
Discussion started by: rakeshtomar82
3 Replies

10. Solaris

modifying date and time and time zone on solaris 5.10 with (redundant server) veritas

I have a cluster of two Solaris server (veritas cluster). one working and the other is standby I am going to change the date on them , and am looking for a secure solution as it is giving an important service. my opinion is that the active one doesn't need to be restarted (if I don't change the... (1 Reply)
Discussion started by: barry1946
1 Replies
GZEXE(1)						      General Commands Manual							  GZEXE(1)

NAME
gzexe - compress executable files in place SYNOPSIS
gzexe name ... DESCRIPTION
The gzexe utility allows you to compress executables in place and have them automatically uncompress and execute when you run them (at a penalty in performance). For example if you execute ``gzexe /usr/bin/gdb'' it will create the following two files: -rwxr-xr-x 1 root root 1026675 Jun 7 13:53 /usr/bin/gdb -rwxr-xr-x 1 root root 2304524 May 30 13:02 /usr/bin/gdb~ /usr/bin/gdb~ is the original file and /usr/bin/gdb is the self-uncompressing executable file. You can remove /usr/bin/gdb~ once you are sure that /usr/bin/gdb works properly. This utility is most useful on systems with very small disks. OPTIONS
-d Decompress the given executables instead of compressing them. SEE ALSO
gzip(1), znew(1), zmore(1), zcmp(1), zforce(1) CAVEATS
The compressed executable is a shell script. This may create some security holes. In particular, the compressed executable relies on the PATH environment variable to find gzip and some standard utilities (basename, chmod, ln, mkdir, mktemp, rm, sleep, and tail). BUGS
gzexe attempts to retain the original file attributes on the compressed executable, but you may have to fix them manually in some cases, using chmod or chown. GZEXE(1)
All times are GMT -4. The time now is 07:23 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy