Sponsored Content
Top Forums Programming String too long to view in GDB Post 302367215 by MrUser on Monday 2nd of November 2009 01:01:46 AM
Old 11-02-2009
Code:
Breakpoint 1, main () at gdb.c:3
3               char *str ="aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa";
(gdb) s
5       printf("%d",strlen(str));
(gdb) s
6       return 0;
(gdb) p str
$1 = 0x8048460 'a' <repeats 200 times>...
(gdb) set print elements 0
(gdb) p str
$2 = 0x8048460 'a' <repeats 824 times>
(gdb)

this is want i tried but its not displaying contents only displaying the number
200 or 824.

can't i see the contents of locations

thanks in advance.

---------- Post updated at 01:01 AM ---------- Previous update was at 12:54 AM ----------



Code:
char *str ="aaaaaaaabaaaaaaaaaaaaaabaaaaaaaaaadaaaaaaaaaasaaafaagaaaadaaaajaaakaaataaaeaaajjaakaalaaiaaaaabadasaaaqaaavaanaakalapamanabavafatayahajavadasaeaazaxacamanabavaahajakalapaoaatareadsaaadaffaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaazaaaaaacaaaaaaaaaaaaaaaaaasdgjlaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaagaaaaaaaaaaaaaaaaaaaaaaaaaaaaaghaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaqaaaaaaaaaaaaaaaaaawaaaaaaaaaaaaaaaaaaaaaaaaaaaaaraaaaaaaaaaaaaataaaaagaaaaaaaaaaaaaaaaaaakaaaaaaaaaaaaaaahaaaaaaaaaaaaaaaaaaaalaaaaaaaaaaaaaaaaaaaaaaaaaaaaaeaaaaaaaaataaaaaaaaaaaaagaaaaaaaaaaakaaaaaaaaaaaaafaaaaaaaaaaaalaaaaaaaaaaqaaaaaaaaaawaaaaaaaaaaaaaaataaaaaaaaaaaaaaaayaaaaaaaaaaaaauaaaaaaaaaaaaaaaraaaaaaagaaaaaaaaaaahaaaaaaaaaaaakaaaaaaaaaaaaaaaaaaalaaaaaaaaaaaaaaaaaeaaaaaaaaraaaaaaaagaaaaaaaahaaaaaaaaaaadaaaaaaaaaaaaaaawaaaaaaaaaaaasaaaaaaaaaaaaahaaaalaaaaaaaaabaaaanaaaaaaamaaadar";
(gdb) s
5       printf("%d",strlen(str));
(gdb) s
6       return 0;
(gdb) p str
$1 = 0x8048460 "aaaaaaaab", 'a' <repeats 14 times>, "baaaaaaaaaadaaaaaaaaaasaaafaagaaaadaaaajaaakaaataaaeaaajjaakaalaaiaaaaabadasaaaqaaavaanaakalapamanabavafatayahajavadasaeaazaxacamanabavaahajakalapaoaatareadsaaadaff", 'a' <repeats 13 times>...

i changed the string randomly but out put is not is not undestandable.
 

10 More Discussions You Might Find Interesting

1. UNIX for Advanced & Expert Users

Long string

I have a long string in ASCII file of approx 60k bytes file size. I need to know 1.How many charcters are adjectly in string. export MAX_COL_SIZE=`awk "length>max{max=length}END{print max}" test.txt` this return file cann't open...can anyone advice why?? 2. How many 'TRX consist in my... (1 Reply)
Discussion started by: u263066
1 Replies

2. Shell Programming and Scripting

Command to view full data "export MAESTRO_OUTPUT_STYLE=LONG"

Hi, Always when I login to Unix, I need to give the following command to view the data properly; export MAESTRO_OUTPUT_STYLE=LONG The reason is that by default the settings export MAESTRO_OUTPUT_STYLE=SHORT Please let me know how I could make LONG as the default and avoid giving the... (1 Reply)
Discussion started by: jmathew99
1 Replies

3. UNIX for Dummies Questions & Answers

finding string in very long file without newlines

What's the best way to find a string in a very long file without newlines in Unix? The standard utility I'm aware of for finding a string in a single file is grep, but for a long file without newlines, I think the output is just going to be the input. I suppose I could use sed to replace the... (5 Replies)
Discussion started by: aaronpoley
5 Replies

4. Shell Programming and Scripting

splitting long string into several lines?

I'm using a barcode scanner to grab ISBNs. Unfortunately, short of hitting "enter" each time (not easy while on a ladder), there's no good way to split it up. So I scanned it into a series of long lines in notepad. Now, I need to split each line into 12-number lines. instead of:... (4 Replies)
Discussion started by: mbourgon
4 Replies

5. Shell Programming and Scripting

Parsing a long string string problem for procmail

Hi everyone, I am working on fetchmail + procmail to filter mails and I am having problem with parsing a long line in the body of the email. Could anyone help me construct a reg exp for this string below. It needs to match exactly as this string. GetRyt... (4 Replies)
Discussion started by: cwiggler
4 Replies

6. UNIX for Dummies Questions & Answers

View 10 lines after the 1st occurence of a string

Hi Everyone, I am looking for the unix command by which I can view 10 lines after the 1st occurence of a string (including the 1st occurence) Example : I have the following lines in a unix file. I have to look for the 1st occurence of the string "How are you" and then view the next 10 lines... (3 Replies)
Discussion started by: kannanfile
3 Replies

7. UNIX for Dummies Questions & Answers

View 5 lines after the last occurence of a string

Hi Everyone, I am looking for the unix command by which I can view 5 lines after the last occurence of a string (including the last occurence) Example : I have the following lines in a unix file. I have to look for the last occurence of the string "How are you" and then view the next 5... (5 Replies)
Discussion started by: kannanfile
5 Replies

8. Solaris

Replacing a string in a long list of files

I have a script that needs to read a file with a long list of /path/filenames - replace the name of the server in each file - and write the file to the same path with a date extension. This is the script that I have so far #!/bin/ksh umask 022 LIST=`scripts.list` for i in $LIST do ... (2 Replies)
Discussion started by: bjdamon
2 Replies

9. Shell Programming and Scripting

Inserting into long delimited string using perl.

Hi, I have a very long pipe delimited string. The length of the string could vary. For example: START|one|two|three|four|five|six|seven START|one|two|three|four|five|six|seven|eight|nine START|one|two|three|four I want to replace in the third occurence of string with another... (9 Replies)
Discussion started by: som.nitk
9 Replies

10. Shell Programming and Scripting

Inserting a long string (readable in sed)

Hi everyone, I am trying to insert a single very long string as the first line of a file, So the following sed commands does what I want; sed '1i\"","a","b","c","d","e","f","g","h","i","j","k","l","m","n","o","p","q","r","s","t","u","v","w","x","y","z"' file.txt Think that all the... (3 Replies)
Discussion started by: hayreter
3 Replies
GDB-ADD-INDEX(1)					       GNU Development Tools						  GDB-ADD-INDEX(1)

NAME
gdb-add-index - Add index files to speed up GDB SYNOPSIS
gdb-add-index filename DESCRIPTION
When GDB finds a symbol file, it scans the symbols in the file in order to construct an internal symbol table. This lets most GDB operations work quickly--at the cost of a delay early on. For large programs, this delay can be quite lengthy, so GDB provides a way to build an index, which speeds up startup. To determine whether a file contains such an index, use the command readelf -S filename: the index is stored in a section named ".gdb_index". Note that the index is never generated for files that do not contain DWARF debug information (sections named ".debug_*"). See more in the GDB manual in node "Index Files" -- shell command "info -f gdb -n 'Index Files'". OPTIONS
SEE ALSO
The full documentation for GDB is maintained as a Texinfo manual. If the "info" and "gdb" programs and GDB's Texinfo documentation are properly installed at your site, the command info gdb should give you access to the complete manual. Using GDB: A Guide to the GNU Source-Level Debugger, Richard M. Stallman and Roland H. Pesch, July 1991. COPYRIGHT
Copyright (c) 1988-2013 Free Software Foundation, Inc. Permission is granted to copy, distribute and/or modify this document under the terms of the GNU Free Documentation License, Version 1.3 or any later version published by the Free Software Foundation; with the Invariant Sections being "Free Software" and "Free Software Needs Free Documentation", with the Front-Cover Texts being "A GNU Manual," and with the Back-Cover Texts as in (a) below. (a) The FSF's Back-Cover Text is: "You are free to copy and modify this GNU Manual. Buying copies from GNU Press supports the FSF in developing GNU and promoting software freedom." gdb-Red Hat Enterprise Linux 7.6.1-51.el7 2014-06-10 GDB-ADD-INDEX(1)
All times are GMT -4. The time now is 04:30 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy