2 2 3 dbxtool dbx (GUI) dbxtool dbx C++ Oracle Solaris Studio 12.2 examples/debugger/debug_tutorial 1. cp -r /opt/solstudio12.2/examples/de

Similar documents
Oracle Change Management Pack, Oracle Diagnostics Pack, Oracle Tuning Packインストレーション・ガイド リリース2.2

Sun Netra 6000 モジュラーシステムご使用にあたって

Oracle8 Workgroup Server for Windows NTインストレーション・ガイド,リリース8.0.6

I117 II I117 PROGRAMMING PRACTICE II SOFTWARE DEVELOPMENT ENV. 1 Research Center for Advanced Computing Infrastructure (RCACI) / Yasuhiro Ohara

r07.dvi

ohp07.dvi

ワークスペースの管理 for Oracle Planning and Budgeting Cloud Service

Introduction Purpose This training course demonstrates the use of the High-performance Embedded Workshop (HEW), a key tool for developing software for

Oracleコール・インタフェース for Windows スタート・ガイド リリース8.1.6

KeySQL for Microsoft Windows 6.0 : B Copyright 2006, Oracle Corporation. All rights reserved. Printed in Japan. * Oracle Corporation Oracle Co

Copyright 2011, Oracle and/or its affiliates. All rights reserved. U.S. GOVERNMENT END USERS: Oracle programs, including any operating system, integra




KeySQL R5.1 Release Note


Release Notes for JMP book



Copyright 2011, Oracle and/or its affiliates. All rights reserved. U.S. GOVERNMENT END USERS: Oracle programs, including any operating system, integra

Quickstart Guide 3rd Edition


RTX830 取扱説明書


r03.dvi

/ SCHEDULE /06/07(Tue) / Basic of Programming /06/09(Thu) / Fundamental structures /06/14(Tue) / Memory Management /06/1

ohp03.dvi

MINI2440マニュアル

memo ii

外部SQLソース入門

Microsoft Windows向けOracle Database 12cでのOracleホーム・ユーザーの導入

TH-47LFX60 / TH-47LFX6N

Oracle データベース移行計画アセスメント:移行前

Java Platform Debugger Architecture Apache JServ Oracle JVM JPDA JVM Tomcat Oracle JVM... 7

HA8000シリーズ ユーザーズガイド ~BIOS編~ HA8000/RS110/TS10 2013年6月~モデル

hotspot の特定と最適化

Release Notes.book

Introduction Purpose This training course describes the configuration and session features of the High-performance Embedded Workshop (HEW), a key tool

double float

yacc.dvi

インターネット接続ガイド v110

owners.book

IP L09( Tue) : Time-stamp: Tue 14:52 JST hig TCP/IP. IP,,,. ( ) L09 IP (2017) 1 / 28

by CASIO W61CA For Those Requiring an English/Chinese Instruction

基本操作ガイド

Microsoft Word - Win-Outlook.docx

RouteMagic Controller RMC-MP200 / MP Version

Oracle RMAN、Oracle SAM QFS、Sun ZFS Storage Applianceを組み合わせた階層型データベース・バックアップ・システムの作成

操作ガイド(本体操作編)

1 I EViews View Proc Freeze

lexex.dvi

Oracle ILOM CLI コマンド用クイックリファレンス - ファームウェアリリース 3.2.x

Nios® II HAL API を使用したソフトウェア・サンプル集 「Modular Scatter-Gather DMA Core」

エレクトーンのお客様向けiPhone/iPad接続マニュアル

konicaminolta.co.jp PageScope Net Care

基本操作ガイド

main.dvi

iPhone/iPad接続マニュアル

エラー処理・分割コンパイル・コマンドライン引数

スライド 1

,,,,., C Java,,.,,.,., ,,.,, i

untitled

RouteMagic Controller RMC-MP200 / MP Version

PBASIC 2.5 PBASIC 2.5 $PBASIC directive PIN type New DEBUG control characters DEBUGIN Line continuation for comma-delimited lists IF THEN ELSE * SELEC

RouteMagic Controller( RMC ) 3.6 RMC RouteMagic RouteMagic Controller RouteMagic Controller MP1200 / MP200 Version 3.6 RouteMagic Controller Version 3

テクニカルホワイトペーパー HP Sure Run HP PC のハードウェア強制されたアプリケーション永続性 HP Sure Run は ハードウェア強制アプリケーション永続化ソリューションで OS の実行中にポリシー適用ハードウェアとの通信を維持する機能を備えています OS 内の HP Sure

. IDE JIVE[1][] Eclipse Java ( 1) Java Platform Debugger Architecture [5] 3. Eclipse GUI JIVE 3.1 Eclipse ( ) 1 JIVE Java [3] IDE c 016 Information Pr

programmingII2019-v01

Oracle Application Server 10g(9

Systemwalker IT Service Management Systemwalker IT Service Management V11.0L10 IT Service Management - Centric Manager Windows


Oracle Lite Windows CE開発者ガイド,リリース4.0.1

REDCap_EULA_FAQ

LC304_manual.ai

ScanFront300/300P セットアップガイド

Transcription:

Oracle Solaris Studio 12.2 dbxtool 2010 9

2 2 3 dbxtool 7 15 24 44 dbx (GUI) dbxtool dbx C++ Oracle Solaris Studio 12.2 examples/debugger/debug_tutorial 1. cp -r /opt/solstudio12.2/examples/debugger/debug_tutorial ~/debug_tutorial 2. make CC -g -c main.cc CC -g -c interp.cc CC -g -c cmd.cc CC -g -c debugger.cc CC -g -c cmds.cc CC -g main.o interp.o cmd.o debugger.o cmds.o -o a.out cmd.h cmd.cc Cmd interp.h interp.cc Interp debugger.h debugger.cc Debugger cmds.h cmds.cc main.h main.cc main() Interp Interp Interp dbx $ a.out > exec date Sun Jun 21 16:13:06 PDT 2009 > display var will display var > stop in X > run running... Oracle Solaris Studio 12.2 dbxtool 2

stopped in X var={ a = 100 b = 101 c = <error> d = 102 e = 103 f = 104 } > quit Goodby $ dbxtool dbxtool installation_directory/bin/dbxtool dbxtool Web dbxtool dbxtool : Oracle Solaris Studio 12.2 dbxtool 3

(Small Toolbar Icons) (Call Stack) : 1. (Call Stack) 2. (Call Stack) (Call Stack) Oracle Solaris Studio 12.2 dbxtool 4

3. (Call Stack) (Call Stack) (Call Stack) (Call Stack) 4. Oracle Solaris Studio 12.2 dbxtool 5

(Breakpoints) : 1. (Breakpoints) 2. (Breakpoints) Oracle Solaris Studio 12.2 dbxtool 6

(Process I/O) : 1. (Process I/O) dbxtool dbxtool 2. dbxtool (Process I/O) (Process I/O) (Dock window) (Editor) 1. (Tools) > (Options) 2. (Options) (Fonts & Colors) 3. (Syntax) (Languages) 4. (Font) 5. (Font Chooser) OK 6. (Options) OK dbx (Dbx Console) ( I/O) ANSI 1. (Tools) > (Options) 2. (Options) (Miscellaneous) 3. (Terminal) 4. (Font Size) (To Type) 5. OK dbxtool $ a.out > display var will display var > Segmentation Fault (core dumped) $ dbxtool $ dbxtool a.out core Oracle Solaris Studio 12.2 dbxtool 7

dbxtool dbx dbxtool Oracle Solaris Studio 12.2 dbxtool 8

Dbx (Dbx Console) Oracle Solaris Studio 12.2 dbxtool 9

program terminated by signal SEGV (no mapping at fault address) 0xff0318f0: strcmp+0x0170: ld [%ol], %gl Current function is Interp::find strcmp() SEGV dbx (Call Stack) (Call Stack) strcmp() 2 0x0 name NULL (Editor) strcmp() ( ) dbx stack_verbose.dbxrc (Call Stack) (Verbose) Oracle Solaris Studio 12.2 dbxtool 10

strcmp() (Variables) (Variables) Oracle Solaris Studio 12.2 dbxtool 11

name NULL SEGV (*cp)->name() (Variables) cp (cp*) name "quit" *cp.dbxrc dbx output_inherited_members (Inherited Members) (Editor) strcmp() name name NULL Oracle Solaris Studio 12.2 dbxtool 12

(*cp)->name() (Editor) name NULL Interp::find() (Debug) > (Stack) > (Make Caller Current) (Make Caller Current) Oracle Solaris Studio 12.2 dbxtool 13

(Call Stack) Interp::dispatch() (Editor) argv[0] NULL Oracle Solaris Studio 12.2 dbxtool 14

(Process I/O) dbxtool 1. (Run) Dbx (Dbx Console) run 2. (Process I/O) SEGV 3. (Discard and Pause) (Editor) Interp::find() strcmp() 4. (Make Caller Current) Interp::dispatch() find() (Show Line Numbers) 127 Oracle Solaris Studio 12.2 dbxtool 15

1. (Editor) Interp::dispatch 2. (Debug) > (New Breakpoint) (New Breakpoint) (New Breakpoint) Oracle Solaris Studio 12.2 dbxtool 16

(Function) 3. OK dbx Dbx (Dbx Console) stop in (dbx) stop in dispatch (4) stop in Interp::dispatch(char*) (dbx) Interp::dispatch Oracle Solaris Studio 12.2 dbxtool 17

(Breakpoints) 1. (Breakpoints) ) 2. 1 (Delete) dbx Dbx (Dbx Console) si dispatch si stop in dbx dbx ~/.dbxrc alias si stop in alias sa stop at alias s step alias n next alias r run (Breakpoint) interp.cc:127 ( (Breakpoint) (GoTo Source) 127 ) dbxtool Oracle Solaris Studio 12.2 dbxtool 18

Interp::dispatch() (Run) (Process I/O) dispatch() culprit find() argv[0] argv 1. (Editor) argv 2. (Debug) > New Watch New Watch New Watch 3. OK 4. Window > Watches Watches 5. argv Oracle Solaris Studio 12.2 dbxtool 19

argv 6. (Step Over) 2 PC int argc = 0; 7. argc argv 8. argc Watches argv Name ( ) 9. (Step Over) argc 0 Oracle Solaris Studio 12.2 dbxtool 20

10. strtok() (Step Over) NULL strtok() strtok (3) DELIMETERS/ 1 line 11. Step Over argv strtok() ( ) NULL 12. find() Signal Caught Discard and Pause Oracle Solaris Studio 12.2 dbxtool 21

13. Interp::dispatch find() a. (Make Caller Current) b. find() c. (Breakpoints) Interp::dispatch () dbxtool d. 2 141 1 14. Run Process I/O find() ( Run ) Oracle Solaris Studio 12.2 dbxtool 22

dbxtool Run dbx ( ) dbxtool 15. strtok() NULL argv[0] NULL 44 Interp::dispatch() Oracle Solaris Studio 12.2 dbxtool 23

dbx in in display nonexistent_var # should yield an error display var stop in X # will cause one "stopped" message and display stop in Y # will cause second "stopped" message and display run cont cont run cont cont $ a.out < in > display nonexistent_var error: Don t know about nonexistent_var > display var will display var > stop in X > stop in Y > run running... stopped in X var={ a = 100 b = 101 c = <error> d = 102 e = 103 f = 104 } > cont stopped in Y var={ a = 105 b = 106 c = <error> d = 107 e = 108 f = 109 } > cont exited > run running... stopped in X var={ a = 110 b = 111 error: cannot get value of var.c c = <error> Oracle Solaris Studio 12.2 dbxtool 24

d = 112 e = 113 f = 114 } > cont stopped in Y var={ a = 115 b = 116 error: cannot get value of var.c c = <error> d = 117 e = 118 f = 119 } > cont exited Goodby 1 c <error> 2 error: cannot get value of var.c error() err_silent c= <error> 1: Run) 1. 2 2. Debug > Debug Executable 3. Debug Executable 4. Arguments <in 5. Run Directory 6. Debug Oracle Solaris Studio 12.2 dbxtool 25

Arguments (Environment) Debug > (Configure Current Session) dbxtool Debug > Debug Recent) dbx Continue Run 2: error() 33 dbx Dbx Console Editor (dbx) func error func Oracle Solaris Studio 12.2 dbxtool 26

1. 33 Editor 2. Run in > display var # should yield an error error() Oracle Solaris Studio 12.2 dbxtool 27

3. Continue 3: Continue > display var # should yield an error 2 2 1. Breakpoints Customize 2. Customize Breakpoint Count Limit 2 3. OK Oracle Solaris Studio 12.2 dbxtool 28

4: 2 error() error() Customize Breakpoint Count Limit Always stop Run error() 2 1 Oracle Solaris Studio 12.2 dbxtool 29

2 runprogram ( [7]) Customize Breakpoint While In runprogram Oracle Solaris Studio 12.2 dbxtool 30

5: err_silent >0 err_silent 31 err_silent Oracle Solaris Studio 12.2 dbxtool 31

err_silent (Make Caller Current) 2 evaluatefield() evaluatefieldprepare() err_silent Make Caller Current printfield() err_silent printfield() printfieldprepare() err_silent Oracle Solaris Studio 12.2 dbxtool 32

err_silent++ err_silent-- printfieldprepare() evaluatefieldprepare() err_silent printfield() printfield () printfield() 6: printfield() 1. printfield() (New Breakpoint) 2. (Function) printfield 3. OK Oracle Solaris Studio 12.2 dbxtool 33

4. Run var.a err_silent 0 Oracle Solaris Studio 12.2 dbxtool 34

5. Continue err_silent 6. Continue err_silent printfield() printfield 1. printfield() Customize Breakpoint (Count Limit) infinity Oracle Solaris Studio 12.2 dbxtool 35

2. Breakpoints a. Breakpoints (Change Visible Columns) b. (Count) (Limit) (While In) c. OK Oracle Solaris Studio 12.2 dbxtool 36

3. error() runprogram() 4. printfield() 15 5. Count Limit (Use current Count value) printfield() 6: err_silent -1 printfield() err_silent-- err_silent++ err_silent Oracle Solaris Studio 12.2 dbxtool 37

err_silent++; err_silent--; err_silent++; err_silent--; err_silent 7: err_silent 1. err_silent (New Breakpoint) 2. (Settings) (Address) & err_silent 3. (When) (After) 4. Operation Write 5. OK Oracle Solaris Studio 12.2 dbxtool 38

6. init() err_silent 1 7. Continue init() 8. Continue init() 9. Continue init() 10. Continue stopin() -1s err_silent -1-1 (Continue) 8: 1. Breakpoint (After) (write) Customize 2. (After) (When) err_silent (After) 3. (Condition) err_silent == -1 4. OK Oracle Solaris Studio 12.2 dbxtool 39

checkthings() err_silent -1 err_silent++ err_silent else Oracle Solaris Studio 12.2 dbxtool 40

9: else 1 checkthings() checkthings() checkthings() Debug > Stack > (Pop Topmost Call) (Pop Topmost Call) err_silent checkthings() checkthings() (Step Into) checkthings() checkthings()() if err_silent -1 Oracle Solaris Studio 12.2 dbxtool 41

10: 1. err_silent++ if Oracle Solaris Studio 12.2 dbxtool 42

2. Debug > (Apply Code Changes) 3. printfield error() 4. error() Oracle Solaris Studio 12.2 dbxtool 43

15 15 NULL SEGV 1. 2. (Debug Executable) <in 3. interp.cc 130 Oracle Solaris Studio 12.2 dbxtool 44

4. Breakpoints ( ) Customize 5. Customize Breakpoint Condition token == 0 6. (Action) Run Script 7. Script assign token = line assign token = "dummy" dbx dummy line "" Oracle Solaris Studio 12.2 dbxtool 45

8. OK dbxtool dbx when at "interp.cc":130 -if token == 0 { assign token = line; } Oracle Solaris Studio 12.2 dbxtool 46

Copyright 2010 U.S. GOVERNMENT RIGHTS Programs, software, databases, and related documentation and technical data delivered to U.S. Government customers are commercial computer software or commercial technical data pursuant to the applicable Federal Acquisition Regulation and agency-specific supplemental regulations. As such, the use, duplication, disclosure, modification, and adaptation shall be subject to the restrictions and license terms set forth in the applicable Government contract, and, to the extent applicable by the terms of the Government contract, the additional rights set forth in FAR 52.227-19, Commercial Computer Software License (December 2007). Oracle America, Inc., 500 Oracle Parkway, Redwood City, CA 94065. redundancy Oracle Java Oracle Corporation AMD Opteron AMD AMD Opteron Advanced Micro Devices, Inc. Intel Intel Xeon Intel Corporation SPARC SPARC International, Inc. UNIX X/Open Company, Ltd. 821-2503 Oracle Corporation 500 Oracle Parkway, Redwood City, CA 94065 U.S.A.