473,320 Members | 2,177 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,320 software developers and data experts.

Does gdb show C++ source code?


I am running gdb on a C++ executable. The code that I wrote looks like
this:

itr = doc.GetFieldIterator();

while (itr.HasNext()) {
Field field = itr.Current();
// Console.WriteLine("Field name: {0}", field.GetName());
// printf("Field name: %s\n", (char *)field.GetName());
printf("Hola %d\n", i);
itr.Next();
i++;
}
However, gdb shows some very different code:

new_allocator() throw() { }
int i = 1;
inline Iterator() : mp_impl(0) {}
new_allocator() throw() { }
basic_string<_CharT, _Traits, _Alloc__str(__lhs);
inline PDFDoc::PDFDoc (const char* filepath) {
basic_string<_CharT, _Traits, _Alloc__str(__lhs);
{ return strlen(__s); }
Is there any way I can have gdb display higher level code?

TIA,

-RFH

Mar 6 '08 #1
11 3375
On Mar 6, 4:01 pm, Ramon F Herrera <ra...@conexus.netwrote:
I am running gdb on a C++ executable. The code that I wrote looks like
this:

itr = doc.GetFieldIterator();

while (itr.HasNext()) {
Field field = itr.Current();
// Console.WriteLine("Field name: {0}", field.GetName());
// printf("Field name: %s\n", (char *)field.GetName());
printf("Hola %d\n", i);
itr.Next();
i++;
}

However, gdb shows some very different code:

new_allocator() throw() { }
int i = 1;
inline Iterator() : mp_impl(0) {}
new_allocator() throw() { }
basic_string<_CharT, _Traits, _Alloc__str(__lhs);
inline PDFDoc::PDFDoc (const char* filepath) {
basic_string<_CharT, _Traits, _Alloc__str(__lhs);
{ return strlen(__s); }

Is there any way I can have gdb display higher level code?

TIA,

-RFH
Consult a GDB newsgroup, forum, after first consulting the manual. The
question is off topic here.
Mar 6 '08 #2
On Mar 6, 6:07 pm, Christopher <cp...@austin.rr.comwrote:
On Mar 6, 4:01 pm, Ramon F Herrera <ra...@conexus.netwrote:
I am running gdb on a C++ executable. The code that I wrote looks like
this:
itr = doc.GetFieldIterator();
while (itr.HasNext()) {
Field field = itr.Current();
// Console.WriteLine("Field name: {0}", field.GetName());
// printf("Field name: %s\n", (char *)field.GetName());
printf("Hola %d\n", i);
itr.Next();
i++;
}
However, gdb shows some very different code:
new_allocator() throw() { }
int i = 1;
inline Iterator() : mp_impl(0) {}
new_allocator() throw() { }
basic_string<_CharT, _Traits, _Alloc__str(__lhs);
inline PDFDoc::PDFDoc (const char* filepath) {
basic_string<_CharT, _Traits, _Alloc__str(__lhs);
{ return strlen(__s); }
Is there any way I can have gdb display higher level code?
TIA,
-RFH
Consult a GDB newsgroup, forum, after first consulting the manual. The
question is off topic here.

There is no such thing as a gdb newsgroup.

Are you saying that C++ developers do not know anything about gdb and
its applicability to C++ code?

I am sure a lot of people would like to disagree.

-RFH

Mar 6 '08 #3
Ramon F Herrera wrote:
On Mar 6, 6:07 pm, Christopher <cp...@austin.rr.comwrote:
Consult a GDB newsgroup, forum, after first consulting the manual.
The question is off topic here.


There is no such thing as a gdb newsgroup.
There are gcc newsgroups. You'd also probably be ok in
comp.unix.programmer, although I couldn't say for certain. I'd review
their FAQ if available.
Are you saying that C++ developers do not know anything about gdb and
its applicability to C++ code?
No, he's saying it's off-topic here. Please review the FAQ for
topicality guidelines.
I am sure a lot of people would like to disagree.
Some would. That's irrelevant. The group consensus is that
platform-specific topics, including tools such as compilers and
debuggers, are off-topic here.


Brian
Mar 6 '08 #4
On Mar 6, 7:23 pm, Christopher <cp...@austin.rr.comwrote:
Consult a GDB newsgroup, forum, after first consulting the manual. The
question is off topic here.
There is no such thing as a gdb newsgroup.
Not my problem. Learn how to research for information.
And your opinions are not my problem, either.

YOU ARE the one off topic, here. You have obvious control issues. Any
psychiatrist will tell you that.

Haven't you heard of a newsgroup called comp.lang.c++.MODERATED? Apply
for a moderator position there, and stop barking.

Oh, now I realize: You have the *need* to bark. See shrink advice
above.

-RFH

Mar 6 '08 #5
Ramon F Herrera wrote:
On Mar 6, 7:23 pm, Christopher <cp...@austin.rr.comwrote:
>>>Consult a GDB newsgroup, forum, after first consulting the manual. The
question is off topic here.
There is no such thing as a gdb newsgroup.
>Not my problem. Learn how to research for information.

And your opinions are not my problem, either.

YOU ARE the one off topic, here. You have obvious control issues. Any
psychiatrist will tell you that.

Haven't you heard of a newsgroup called comp.lang.c++.MODERATED? Apply
for a moderator position there, and stop barking.

Oh, now I realize: You have the *need* to bark. See shrink advice
above.
No, the FAQ for the group says you're off-topic. See
http://www.parashift.com/c++-faq-lit...t.html#faq-5.9

Also, if there weren't a bunch of off-topic grouches, the signal to
noise ratio for this group would be awful, and it would devolve into yet
another Windows programming group.
Mar 7 '08 #6
There is a lesson for you to learn, Chris:

Just because you don't know the answer to something, it doesn't mean
it is off topic.

-RFH

Mar 7 '08 #7
Ramon F Herrera wrote:
There is a lesson for you to learn, Chris:

Just because you don't know the answer to something, it doesn't mean
it is off topic.
And *YOU* need to learn to RTFFAQ. In particular, section 5.

http://www.parashift.com/c++-faq-lite/how-to-post.html
Mar 7 '08 #8
On Mar 6, 5:59 pm, Ramon F Herrera <ra...@conexus.netwrote:
There is a lesson for you to learn, Chris:

Just because you don't know the answer to something, it doesn't mean
it is off topic.

-RFH
It took me 5 seconds to Google the answer before I made my first
reply. I also happen to have a GDB cheat sheet in front of me
containing the answer as well, which was written after reading the
manual for GDB online at their website. That is something you should
be doing instead of trolling here. Again, learn how to research before
you learn how to program.
You are correct, there are lots of things I do not know that _are_ on
topic. I might even ask about some of those in this group *gasp*.
However, the use of your choice in debuggers is not one of them.
Mar 7 '08 #9
On Mar 6, 2:01*pm, Ramon F Herrera <ra...@conexus.netwrote:
I am running gdb on a C++ executable. The code that I wrote looks like
this:

itr = doc.GetFieldIterator();

while (itr.HasNext()) {
* * Field field = itr.Current();
* * // Console.WriteLine("Field name: {0}", field.GetName());
* * // printf("Field name: %s\n", (char *)field.GetName());
* * printf("Hola %d\n", i);
* * itr.Next();
* * i++;
* * }

However, gdb shows some very different code:

new_allocator() throw() { }
int * * * * * * i = 1;
inline Iterator() : mp_impl(0) {}
new_allocator() throw() { }
basic_string<_CharT, _Traits, _Alloc__str(__lhs);
inline PDFDoc::PDFDoc (const char* filepath) {
basic_string<_CharT, _Traits, _Alloc__str(__lhs);
{ return strlen(__s); }

Is there any way I can have gdb display higher level code?

TIA,

-RFH
If you are using gcc, try "g++ -g file.cpp" I think that does what
you are looking for
Mar 7 '08 #10
ha*************@gmail.com wrote:

If you are using gcc

How about not validating the moron's bad behavior?


Brian
Mar 7 '08 #11
In article <ac789454-f21b-4537-9e4d-5522c23596b0
@m3g2000hsc.googlegroups.com>, ra***@conexus.net says...

[ ... ]
YOU ARE the one off topic, here. You have obvious control issues. Any
psychiatrist will tell you that.

Haven't you heard of a newsgroup called comp.lang.c++.MODERATED? Apply
for a moderator position there, and stop barking.
....and Mr. Herrera's posts suffer the death of a thousand plonks!

--
Later,
Jerry.

The universe is a figment of its own imagination.
Mar 9 '08 #12

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

2
by: Mike | last post by:
I am sure that I am making a simple boneheaded mistake and I would appreciate your help in spotting in. I have just installed apache_2.0.53-win32-x86-no_ssl.exe php-5.0.3-Win32.zip...
6
by: bayram guzer | last post by:
hi everybody, i have very strange error. i can not see some of the asp pages on my browser. when i look from view source, all the source is there but browser does not show anything, just an empty...
21
by: Jim | last post by:
Hi I am a newbie to asp and i built this test program: <HTML> <HEAD><TITLE>Test</TITLE></HEAD> <BODY> the time is <% = Time %> </BODY> </HTML>
1
by: Luis Esteban Valencia | last post by:
Compilation Error Description: An error occurred during the compilation of a resource required to service this request. Please review the following specific error details and modify your source...
4
by: Craig831 | last post by:
First off, I apologize if this gets long. I'm simply trying to give you all enough information to help me out. I'm writing (almost finished, actually), my first VB.Net application. It's a forms...
12
by: Nalaka | last post by:
Hi, I suddenly started getting a lot of errors from html validation (some CSS) so I followed the following instructions to disable it. If you'd rather not have these types of HTML validation...
15
by: amit.man | last post by:
Hi, i have newbie qestion, when i write #include <somthing.h> the precompiler subtitue that line with the lines from "somthing.h" header file. when, where and how the compiler insert the...
13
by: Bob Jones | last post by:
Here is my situation: I have an aspx file stored in a resource file. All of the C# code is written inline via <script runat="server"tags. Let's call this page B. I also have page A that contains...
13
by: Seb | last post by:
With php I can simply append a s to the file extension, eg. .phps and if the user request the file the source will be shown in the browser. Is there a semilar functionality for aspx pages? ...
19
by: pmw | last post by:
Hi I've got a problem with my current application. I currently use Windows Vista with Visual Studio Express 2008. If I compile the application on Vista, it works fine on Vista, but it doesn't...
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
0
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
1
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.