From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 27672 invoked by alias); 30 Jun 2014 12:00:09 -0000 Mailing-List: contact gdb-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-owner@sourceware.org Received: (qmail 27617 invoked by uid 89); 30 Jun 2014 12:00:05 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-2.6 required=5.0 tests=BAYES_00,FREEMAIL_FROM,RCVD_IN_DNSWL_LOW,SPF_PASS autolearn=ham version=3.3.2 X-HELO: mail-oa0-f54.google.com Received: from mail-oa0-f54.google.com (HELO mail-oa0-f54.google.com) (209.85.219.54) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with (AES128-SHA encrypted) ESMTPS; Mon, 30 Jun 2014 12:00:01 +0000 Received: by mail-oa0-f54.google.com with SMTP id eb12so8636043oac.41 for ; Mon, 30 Jun 2014 05:00:00 -0700 (PDT) X-Received: by 10.60.133.233 with SMTP id pf9mr21669776oeb.30.1404129600096; Mon, 30 Jun 2014 05:00:00 -0700 (PDT) MIME-Version: 1.0 Received: by 10.182.66.116 with HTTP; Mon, 30 Jun 2014 04:59:40 -0700 (PDT) In-Reply-To: References: From: Aleksey Midenkov Date: Mon, 30 Jun 2014 12:00:00 -0000 Message-ID: Subject: Re: Break on library load before main To: Andreas Schwab Cc: gdb@sourceware.org Content-Type: text/plain; charset=UTF-8 X-SW-Source: 2014-06/txt/msg00102.txt.bz2 On Mon, Jun 30, 2014 at 3:54 PM, Andreas Schwab wrote: > Aleksey Midenkov writes: > >> I tried to stop execution before main() with following methods: >> >> 1. break dlopen >> 2. catch load >> 3. catch syscall uselib >> >> Nothing works! When I issue 'start', all libraries get loaded without >> stop before main(). I should mention, that 'catch load' somehow works. >> It stops somewhere, but very late (see attachment for output log). > > Try set stop-on-solib-events 1. > It also stops too late (after finished reading all symbols): ... Reading symbols from /usr/lib/x86_64-linux-gnu/libogg.so.0...(no debugging symbols found)...done. Loaded symbols for /usr/lib/x86_64-linux-gnu/libogg.so.0 Reading symbols from /lib/x86_64-linux-gnu/libresolv.so.2...Reading symbols from /usr/lib/debug/lib/x86_64-linux-gnu/libresolv-2.19.so...done. done. Loaded symbols for /lib/x86_64-linux-gnu/libresolv.so.2 Stopped due to shared library event: Inferior loaded /usr/lib/libkdecore.so.5 /home/midenok/src/kde/kdevelop/stable/opt/lib/libkdevplatforminterfaces.so.7 /home/midenok/src/kde/kdevelop/stable/opt/lib/libkdevplatformshell.so.7 /usr/lib/libktexteditor.so.4 /usr/lib/x86_64-linux-gnu/libQtDeclarative.so.4 /usr/lib/libkdeclarative.so.5 /home/midenok/src/kde/kdevelop/stable/opt/lib/libsublime.so.7 /usr/lib/libkdeui.so.5 /usr/lib/x86_64-linux-gnu/libQtDBus.so.4 /usr/lib/x86_64-linux-gnu/libQtCore.so.4 /usr/lib/x86_64-linux-gnu/libQtGui.so.4 /usr/lib/x86_64-linux-gnu/libstdc++.so.6 /lib/x86_64-linux-gnu/libc.so.6 /usr/lib/x86_64-linux-gnu/libQtNetwork.so.4 /lib/x86_64-linux-gnu/libz.so.1 ... Strange message 'Inferior loaded ...'. It lists all libs loaded. Shouldn't it stop on each lib one-by-one?