LinuxQuestions.org
Welcome to the most active Linux Forum on the web.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Non-*NIX Forums > Programming
User Name
Password
Programming This forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.

Notices


Reply
  Search this Thread
Old 05-23-2013, 04:40 PM   #16
atlantis43
Member
 
Registered: Feb 2013
Posts: 289

Original Poster
Rep: Reputation: Disabled

had some experience with 'immediate window' in MSaccessBasic (with a lot of help from access user forums), but that was nice & simple. Never used a true source code debugger before.
With gdb, I know commands like b & d & infolocals, but the real 'programmers' commands like 's' are beyond me, and I can rarely get gdb to show me what's going on in called programs.
 
Old 05-23-2013, 05:09 PM   #17
PTrenholme
Senior Member
 
Registered: Dec 2004
Location: Olympia, WA, USA
Distribution: Fedora, (K)Ubuntu
Posts: 4,187

Rep: Reputation: 354Reputation: 354Reputation: 354Reputation: 354
I don't think anyone mentioned to the OP that escape character precedes the character to be escaped. In many of the posted examples, the backslash seemed to follow the character to be escaped.
 
1 members found this post helpful.
Old 05-23-2013, 05:21 PM   #18
atlantis43
Member
 
Registered: Feb 2013
Posts: 289

Original Poster
Rep: Reputation: Disabled
no----I meant s for 'step' thru code as opposed to n for 'next'
 
Old 05-23-2013, 06:17 PM   #19
theNbomr
LQ 5k Club
 
Registered: Aug 2005
Distribution: OpenSuse, Fedora, Redhat, Debian
Posts: 5,399
Blog Entries: 2

Rep: Reputation: 908Reputation: 908Reputation: 908Reputation: 908Reputation: 908Reputation: 908Reputation: 908Reputation: 908
You don't need to step through code for this.
Code:
? 
? cat literaStringsTest.c 
#include <stdio.h>
#include <stdlib.h>

char  literalString[] = "This literal string has a d-quote \" embedded in it.";

int main( int argc, char * argv[] ){

    puts( "A literal string with a percent-D symbol: %d \n" );
    printf( "A literal string with a percent-D symbol: %%d \n" );
    exit(0);

}
?
Code:
? 
? make CFLAGS+=-g literaStringsTest
cc -g    literaStringsTest.c   -o literaStringsTest
?
Code:
? 
? gdb literaStringsTest
GNU gdb (GDB) 7.0.1-debian
Copyright (C) 2009 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law.  Type "show copying"
and "show warranty" for details.
This GDB was configured as "i486-linux-gnu".
For bug reporting instructions, please see:
<http://www.gnu.org/software/gdb/bugs/>...
Reading symbols from /home/bomr/Util/c/literaStringsTest...done.
(gdb) x /56c literalString
0x80496c0 <literalString>:      84 'T'  104 'h' 105 'i' 115 's' 32 ' '  108 'l' 105 'i' 116 't'
0x80496c8 <literalString+8>:    101 'e' 114 'r' 97 'a'  108 'l' 32 ' '  115 's' 116 't' 114 'r'
0x80496d0 <literalString+16>:   105 'i' 110 'n' 103 'g' 32 ' '  104 'h' 97 'a'  115 's' 32 ' '
0x80496d8 <literalString+24>:   97 'a'  32 ' '  100 'd' 45 '-'  113 'q' 117 'u' 111 'o' 116 't'
0x80496e0 <literalString+32>:   101 'e' 32 ' '  34 '"'  32 ' '  101 'e' 109 'm' 98 'b'  101 'e'
0x80496e8 <literalString+40>:   100 'd' 100 'd' 101 'e' 100 'd' 32 ' '  105 'i' 110 'n' 32 ' '
0x80496f0 <literalString+48>:   105 'i' 116 't' 46 '.'  0 '\000'        0 '\000'        0 '\000'        0 '\000'        0 '\000'
(gdb) x /56xb literalString
0x80496c0 <literalString>:      0x54    0x68    0x69    0x73    0x20    0x6c    0x69    0x74
0x80496c8 <literalString+8>:    0x65    0x72    0x61    0x6c    0x20    0x73    0x74    0x72
0x80496d0 <literalString+16>:   0x69    0x6e    0x67    0x20    0x68    0x61    0x73    0x20
0x80496d8 <literalString+24>:   0x61    0x20    0x64    0x2d    0x71    0x75    0x6f    0x74
0x80496e0 <literalString+32>:   0x65    0x20    0x22    0x20    0x65    0x6d    0x62    0x65
0x80496e8 <literalString+40>:   0x64    0x64    0x65    0x64    0x20    0x69    0x6e    0x20
0x80496f0 <literalString+48>:   0x69    0x74    0x2e    0x00    0x00    0x00    0x00    0x00
(gdb)
--- rod.

Last edited by theNbomr; 05-23-2013 at 06:19 PM.
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
constant pointer to variable char utkarshrawat Programming 2 03-09-2012 10:21 AM
How do I point a char pointer to a part of another char array? trist007 Programming 8 11-06-2010 07:56 PM
char pointer confusion bhatia.ankur8 Linux - General 2 07-07-2010 02:06 AM
[SOLVED] Why is char* a string and not a pointer to a char? el_b Programming 2 09-25-2009 10:33 AM
C : Function to modify pointer to char introuble Programming 2 06-21-2006 12:24 PM

LinuxQuestions.org > Forums > Non-*NIX Forums > Programming

All times are GMT -5. The time now is 12:04 AM.

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