Mirror of the gdb mailing list
 help / color / mirror / Atom feed
* errors in GDB reading symbols
@ 2009-08-01 21:38 kceiwH
  2009-08-02 23:45 ` kceiwH
  2009-08-03 16:53 ` Tom Tromey
  0 siblings, 2 replies; 17+ messages in thread
From: kceiwH @ 2009-08-01 21:38 UTC (permalink / raw)
  To: gdb

Hi,

I try to write a program to convert a line number of the source code  
to the corresponding memory address. The program will link to libgdb,  
libbfd, libiberty, libopcodes, which are generated when you compile  
GDB. My problem is that the number of symbols (more than ten thousand)  
of a given executable file that my program reads is quite different  
from that (less than one hundred) GDB reads.

All I did is mainly calling the interfaces to read an executable file  
and its symbols. That is, I call exec_file_attach and  
symbol_file_add_main. They should read the file's symbols.
My last try is copying the codes from functions main (in gdb/gdb.c),  
gdb_main (in gdb/main.c), and captured_main (in gdb/main.c), without  
the statement captured_command_loop, and putting them in a single  
function in my program. I also changed the names of some local  
variables, so I don't need to pass them as parameters. And the paths  
such as BINDIR, DEBUGDIR, gdb_sysroot are set to the current directory  
".". Even though, the program still reads more than ten thousand  
symbols of a given executable file.

I compile my program with linking to libgdb, libbfd, libopcodes,  
libiberty. And I also compiled GDB and run it to test whether my  
program behaved correctly. They are based on the same codes. The only  
differences are the path names. So my program should behave like GDB.  
But my program reads much more symbols than the GDB does. Is there  
anybody knows why that happen. I appreciate if you can give a clue.

Regards,

Mao



^ permalink raw reply	[flat|nested] 17+ messages in thread
* Re: errors in GDB reading symbols
@ 2009-08-07 20:48 Marco van de Voort
  2009-08-11 21:00 ` Tom Tromey
  0 siblings, 1 reply; 17+ messages in thread
From: Marco van de Voort @ 2009-08-07 20:48 UTC (permalink / raw)
  To: tromey; +Cc: gdb


> It is definitely still very much used in the Dos/go32v2 and Win32 versino of
> the IDE. It is also used in our own builds of the Linux- version of the IDE,

FreeBSD also.

> but less so in the versions packaged by distributions (mostly because of
> there being no separate working "libgdb.a" package).
> Other than the implementation cost that you noted, the main opposition to
> using MI that I've heard are

>a) as mentioned by Marco, it's probably impossible to use it on Dos (since
>there's no multitasking)

IIRC the win9x pipe situation is not very good either. Which limits you on
Windows too, if you still support win9x.

>b) communication with gdb via MI is supposedly dreadfully slow on Windows (I
>don't have Windows, so I can't confirm or deny this)

File I/O and starting binaries in particular on Windows is relatively slow,
which is why a fragmentation over multiple binaries is not desirable.
Moreover, it is simply not the culture on non-unix to do so.

Partially the earlier own debugger discussion is fueled by one of the
improvements of FPC's internal linker relative to LD, the experience that
makes the call for an own debugger so vocal. It knocks off tens of seconds
in the compile-start-with-debug cycle, and makes GDB the next bottleneck (this
is for Lazarus, not the textmode IDE)

This is also because most FPC users rate speed relative to something like
Delphi, and thus have a low tolerance for pain and slowliness. Delphi does
typically compile-start-with-debug in one second if the compile is
relatively incremental.....

Personally I think the own debugger part, even IF it ever comes to fruition
is still far, far away, and for a few selected platforms only. So we still
have to live with GDB quite a while.

Forcing the MI interface would effectively kill the textmode IDE, it is
effectively in maintenance for years. If there is something to be done on
the GDB side, I'd prefer investing time in libgdb. What are the problems
with it? Does something need updating, etc?

I don't see the point of the MI interface at all btw. What is the idea
behind it? And why does it need to be one size fits all to desperately?


^ permalink raw reply	[flat|nested] 17+ messages in thread

end of thread, other threads:[~2009-08-21 17:32 UTC | newest]

Thread overview: 17+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2009-08-01 21:38 errors in GDB reading symbols kceiwH
2009-08-02 23:45 ` kceiwH
2009-08-03 16:53 ` Tom Tromey
2009-08-03 17:01   ` Daniel Jacobowitz
2009-08-03 20:47     ` Baurzhan Ismagulov
2009-08-04 14:33     ` Tom Tromey
2009-08-04 14:46       ` Daniel Jacobowitz
2009-08-04 14:47         ` Daniel Jacobowitz
2009-08-04 14:52       ` Jonas Maebe
2009-08-04 14:55         ` Daniel Jacobowitz
2009-08-06 17:09         ` Tom Tromey
2009-08-06 21:00           ` Jonas Maebe
2009-08-07 16:24             ` Daniel Jacobowitz
2009-08-07 20:48 Marco van de Voort
2009-08-11 21:00 ` Tom Tromey
2009-08-12  0:56   ` Paul Pluzhnikov
2009-08-21 17:33     ` Tom Tromey

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox