1 /* Copyright (C) 2021-2024 Free Software Foundation, Inc.
4 This file is part of GNU Binutils.
6 This program is free software; you can redistribute it and/or modify
7 it under the terms of the GNU General Public License as published by
8 the Free Software Foundation; either version 3, or (at your option)
11 This program is distributed in the hope that it will be useful,
12 but WITHOUT ANY WARRANTY; without even the implied warranty of
13 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 GNU General Public License for more details.
16 You should have received a copy of the GNU General Public License
17 along with this program; if not, write to the Free Software
18 Foundation, 51 Franklin Street - Fifth Floor, Boston,
19 MA 02110-1301, USA. */
29 #include "MemorySpace.h"
31 #include "dbe_types.h"
32 #include "dbe_structs.h"
47 friend class DbeSession
;
49 Settings (Application
*_app
);
50 Settings (Settings
*_settings
);
52 void read_rc (bool ipc_or_rdt_mode
); // read all rc files
53 char *read_rc (char *path
); // read rc file
54 void buildMasterTabList (); // build list of Tabs that can be invoked
55 void updateTabAvailability (); // update for datamode, leaklist
56 Cmd_status
set_name_format (char *str
); // from a string
59 get_TabList () // Get the list of tabs for this view
65 get_MemTabState () // Get the list and order of memory tabs for this view
76 // Set the list of memory tabs for this view
77 void set_MemTabState (Vector
<bool>*sel
);
79 // add a newly-defined memory object tab
80 void mobj_define (MemObjType_t
*, bool state
);
82 // add a newly-defined index object tab
83 void indxobj_define (int type
, bool state
);
86 get_IndxTabState () // Get the list and order of index tabs for this view
88 return indx_tab_state
;
94 return indx_tab_order
;
97 // Set the list of index tabs for this view
98 void set_IndxTabState (Vector
<bool>*sel
);
101 set_name_format (int fname_fmt
, bool soname_fmt
)
103 name_format
= Histable::make_fmt (fname_fmt
, soname_fmt
);
112 // public methods for setting and accessing the settings
113 Cmd_status
set_view_mode (char *str
, bool rc
); // from a string
116 set_view_mode (VMode mode
)
127 // set the en_desc expression/on/off
128 Cmd_status
set_en_desc (char *str
, bool rc
); // from a string
129 // check if the lineage or the target name matches the en_desc expression
130 bool check_en_desc (const char *lineage
, const char *targname
);
132 char *set_limit (char *str
, bool rc
); // from a string
135 set_limit (int _limit
)
147 char *set_printmode (char *_pmode
);
149 // processing compiler commentary visibility bits
150 Cmd_status
proc_compcom (const char *cmd
, bool isSrc
, bool rc
);
152 // return any error string from processing visibility settings
153 char *get_compcom_errstr (Cmd_status status
, const char *cmd
);
155 // methods for setting and getting strings, and individual settings
182 set_cmpline_visible (bool v
)
188 set_funcline_visible (bool v
)
190 funcline_visible
= v
;
194 set_src_visible (int v
)
206 set_srcmetric_visible (bool v
)
208 srcmetric_visible
= v
;
212 get_srcmetric_visible ()
214 return srcmetric_visible
;
218 set_hex_visible (bool v
)
229 // processing and accessing the threshold settings
230 Cmd_status
proc_thresh (char *cmd
, bool isSrc
, bool rc
);
235 return threshold_src
;
241 return threshold_dis
;
244 // process a tlmode setting
245 Cmd_status
proc_tlmode (char *cmd
, bool rc
);
248 set_tlmode (int _tlmode
)
260 set_stack_align (int _stack_align
)
262 stack_align
= _stack_align
;
272 set_stack_depth (int _stack_depth
)
274 stack_depth
= _stack_depth
;
283 // process a tabs setting: called when the tab list is requested
284 Cmd_status
proc_tabs (bool _rdtMode
);
286 Cmd_status
proc_tldata (const char *cmd
, bool rc
); // process a tldata setting
287 void set_tldata (const char* tldata_string
);
291 get_default_metrics ()
303 set_ignore_no_xhwcprof (bool v
) // ignore no xhwcprof errors for dataspace
305 ignore_no_xhwcprof
= v
;
309 get_ignore_no_xhwcprof ()
311 return ignore_no_xhwcprof
;
315 set_ignore_fs_warn (bool v
) // ignore filesystem warnings in experiments
321 get_ignore_fs_warn ()
323 return ignore_fs_warn
;
327 static char *add_pathmap (Vector
<pathmap_t
*> *v
, const char *from
, const char *to
);
328 void set_pathmaps (Vector
<pathmap_t
*> *newPathMap
);
330 // add a LoadObject expansion setting
331 bool set_libexpand (char *, enum LibExpand
, bool);
332 enum LibExpand
get_lo_setting (char *);
334 // set LoadObject expansion defaults back to .rc specifications
335 bool set_libdefaults ();
338 set_compare_mode (int mode
)
352 return dbe_strdup (machinemodel
);
355 char *preload_libdirs
;
360 // default strings from .rc file
374 char *str_search_path
;
375 char *str_name_format
;
382 // Processed settings
383 bool en_desc
; // controls for reading descendant processes
384 char * en_desc_usr
; // selective descendants: user specificaton
385 regex_t
* en_desc_cmp
; // selective descendants: compiled specification
386 Histable::NameFormat name_format
; // long/short/mangled naming for C++/Java
387 VMode view_mode
; // Java mode
388 int src_compcom
; // compiler commentary visibility for anno-src
389 int dis_compcom
; // compiler commentary visibility for anno-dis
390 int threshold_src
; // threshold for anno-src
391 int threshold_dis
; // threshold for anno-dis
392 int cmpline_visible
; // show compile-line flags
393 int funcline_visible
; // show compile-line flags
394 int src_visible
; // show source in disasm
395 bool srcmetric_visible
; // show metrics for source in disasm
396 bool hex_visible
; // show hex code in disasm
397 char* tldata
; // timeline data type string
398 int tlmode
; // timeline mode for bars
399 int stack_align
; // timeline stack alignment
400 int stack_depth
; // timeline stack depth
401 int limit
; // print limit
402 enum PrintMode print_mode
;// print mode
403 char print_delim
; // the delimiter, if print mode = PM_DELIM_SEP_LIST
404 int compare_mode
; // compare mode
406 char *machinemodel
; // machine model for Memory Objects
408 bool ignore_no_xhwcprof
; // ignore no -xhwcprof data in dataspace
409 bool ignore_fs_warn
; // ignore file-system recording warning
411 void set_rc (const char *path
, bool msg
, Emsgqueue
*commentq
,
412 bool override
, bool ipc_or_rdt_mode
= false);
414 Vector
<DispTab
*> *tab_list
;
415 Vector
<pathmap_t
*> *pathmaps
;
416 Vector
<lo_expand_t
*> *lo_expands
;
417 enum LibExpand lo_expand_default
;
418 bool is_loexpand_default
;
419 Vector
<bool> *mem_tab_state
;
420 Vector
<int> *mem_tab_order
;
421 Vector
<bool> *indx_tab_state
;
422 Vector
<int> *indx_tab_order
;
425 #endif /* ! _SETTINGS_H */