From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 16135 invoked by alias); 22 Dec 2001 12:01:55 -0000 Mailing-List: contact gdb-help@sources.redhat.com; run by ezmlm Precedence: bulk List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-owner@sources.redhat.com Received: (qmail 16110 invoked from network); 22 Dec 2001 12:01:53 -0000 Received: from unknown (HELO fep02-svc.swip.net) (130.244.199.130) by sources.redhat.com with SMTP; 22 Dec 2001 12:01:53 -0000 Received: from pbncomputer ([193.217.205.22]) by fep02-svc.swip.net with SMTP id <20011222120142.CVXE22802.fep02-svc.swip.net@pbncomputer> for ; Sat, 22 Dec 2001 13:01:42 +0100 Message-ID: <000b01c18ae2$2d231380$45a1fea9@pbncomputer> From: "Nils Henrik Lorentzen" To: Subject: Using gdb symtab code Date: Sat, 22 Dec 2001 04:01:00 -0000 MIME-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable X-Priority: 3 X-MSMail-Priority: Normal X-Mailer: Microsoft Outlook Express 5.00.2615.200 X-MimeOLE: Produced By Microsoft MimeOLE V5.00.2615.200 X-SW-Source: 2001-12/txt/msg00183.txt.bz2 Hi, I am writing a small utility to detect memleaks, and I would like to print some informal backtraces for the leaks. So I started writing code to read in ELF files, demangling the symbols etc. Then I thought that GDB probably allready implements all this stuff, and could be used for the task. I could write a perl script or something to start gdb, send commands to it and parse the output, but that is IMHO the wrong way to do it. The right solution would IMO be to separate the needed code in GDB into a separate lib and use that. Such a generic lib for symtab handling and possibly also backtrace recording could also be very usefull for other similar apps like GNU Checker and for printing backtraces in crash handlers. Anyways, I took a dive into the code & docs and it seems a bit messy.. There does not seem to be a clean and abstract separation between the UI side and the symtab side of the code. Also there seems to be much usage of global variables. So my question is: How would people look at it if I used some GDB code as a starting-point for a separate symbol-table handling lib with a clean API ? It would of course be under a compatible license. I see there is an LGPL in the top directory of gdb. Does this mean that I could put such a lib under LGPL if I only used the symtab/objectfile parts of the GDB code ? Nils Henrik